Skip to content

Commit

Permalink
Merge branch 'master' into typescript-bundle-improvements
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/docusaurus-plugin-debug/package.json
#	packages/docusaurus-theme-common/package.json
  • Loading branch information
slorber committed Mar 17, 2021
2 parents 443ba70 + b99a403 commit 10502d3
Show file tree
Hide file tree
Showing 140 changed files with 11,565 additions and 369 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ packages/docusaurus-*/lib/*
packages/docusaurus-1.x/lib/core/metadata.js
packages/docusaurus-1.x/lib/core/MetadataBlog.js
packages/docusaurus-*/lib-next/
packages/docusaurus-init/templates/**/*.md
__fixtures__
85 changes: 85 additions & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,90 @@
# Docusaurus 2 Changelog

## 2.0.0-alpha.72 (2021-03-16)

### :boom: Breaking Change

Starting with this release for a proper work of i18n functionality, you need to either use Node v14+ or in case of using earlier version of Node.js install [`full-icu` package](https://www.npmjs.com/package/full-icu) and set `NODE_ICU_DATA` environment variable in your npm scripts, for example:

```json
"scripts": {
"start": "cross-env NODE_ICU_DATA=node_modules/full-icu docusaurus start"
}
```

#### :rocket: New Feature

- `docusaurus-init`
- [#4302](https://github.com/facebook/docusaurus/pull/4302) feat(v2): Improve the initial templates ([@ShinteiMai](https://github.com/ShinteiMai))
- `docusaurus-theme-classic`
- [#4390](https://github.com/facebook/docusaurus/pull/4390) feat(v2): Add korean default translations ([@koko8829](https://github.com/koko8829))

#### :bug: Bug Fix

- `docusaurus-theme-classic`
- [#4429](https://github.com/facebook/docusaurus/pull/4429) chore(v2): upgrade Infima to v0.2.0-alpha.21 ([@lex111](https://github.com/lex111))
- [#4428](https://github.com/facebook/docusaurus/pull/4428) fix(v2): allow using pre tag in Markdown directly ([@lex111](https://github.com/lex111))
- [#4381](https://github.com/facebook/docusaurus/pull/4381) fix(v2): specify proper TS path in classic theme ([@lex111](https://github.com/lex111))
- [#4383](https://github.com/facebook/docusaurus/pull/4383) fix(v2): set theme color mode for SSR ([@lex111](https://github.com/lex111))
- `docusaurus-plugin-pwa`
- [#4424](https://github.com/facebook/docusaurus/pull/4424) fix(v2): add missing peer dep on @babel/core ([@SimenB](https://github.com/SimenB))
- [#4377](https://github.com/facebook/docusaurus/pull/4377) fix(v2): PWA issues + improve docs ([@slorber](https://github.com/slorber))
- `docusaurus`
- [#4407](https://github.com/facebook/docusaurus/pull/4407) fix(v2): broken link checker should not report false positives when using encoded chars ([@Harvtronix](https://github.com/Harvtronix))
- Other
- [#4410](https://github.com/facebook/docusaurus/pull/4410) fix(v1): Fix v1 site deployment with Crowdin again... ([@slorber](https://github.com/slorber))
- [#4396](https://github.com/facebook/docusaurus/pull/4396) fix(v1): Temp fix v1 site deployment: fail-safe on Crowdin upload translations error ([@slorber](https://github.com/slorber))
- [#4395](https://github.com/facebook/docusaurus/pull/4395) fix(v1): fix v1 site deploy issues ([@slorber](https://github.com/slorber))

#### :nail_care: Polish

- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-plugin-sitemap`, `docusaurus-theme-classic`, `docusaurus-types`, `docusaurus-utils-validation`, `docusaurus`
- [#4418](https://github.com/facebook/docusaurus/pull/4418) refactor(v2): correct plugin types ([@armano2](https://github.com/armano2))
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-theme-common`, `docusaurus-utils`, `docusaurus`
- [#4405](https://github.com/facebook/docusaurus/pull/4405) refactor(v2): i18n cleanups / refactors ([@longlho](https://github.com/longlho))
- `docusaurus-module-type-aliases`
- [#4387](https://github.com/facebook/docusaurus/pull/4387) refactor(v2): add ExecutionEnvironment, BrowserOnly, isInternalUrl to type aliases ([@armano2](https://github.com/armano2))
- `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-utils`
- [#4402](https://github.com/facebook/docusaurus/pull/4402) refactor(v2): merge linkify function used in blog and docs and align properties ([@armano2](https://github.com/armano2))
- `docusaurus-plugin-client-redirects`, `docusaurus-plugin-content-docs`, `docusaurus-theme-common`, `docusaurus-utils-validation`, `docusaurus`
- [#4382](https://github.com/facebook/docusaurus/pull/4382) refactor(v2): correct some of type errors reported by eslint ([@armano2](https://github.com/armano2))
- `docusaurus-theme-bootstrap`, `docusaurus-theme-classic`, `docusaurus-theme-common`
- [#4385](https://github.com/facebook/docusaurus/pull/4385) refactor(v2): add missing theme-classic types ([@armano2](https://github.com/armano2))

#### :memo: Documentation

- [#4416](https://github.com/facebook/docusaurus/pull/4416) docs(v2): add Realtime Web Applications Workshop to showcase ([@lowenhere](https://github.com/lowenhere))
- [#4408](https://github.com/facebook/docusaurus/pull/4408) docs(v2): add gladysassistant.com to showcase ([@Pierre-Gilles](https://github.com/Pierre-Gilles))
- [#4386](https://github.com/facebook/docusaurus/pull/4386) docs(v2): Showcase the pnpm docs ([@zkochan](https://github.com/zkochan))
- [#4367](https://github.com/facebook/docusaurus/pull/4367) docs(v2): releasing i18n blog post ([@slorber](https://github.com/slorber))

#### :house: Internal

- `docusaurus-1.x`
- [#4401](https://github.com/facebook/docusaurus/pull/4401) chore(v1): fix CircleCI v1 site deploy ([@slorber](https://github.com/slorber))
- Other
- [#4399](https://github.com/facebook/docusaurus/pull/4399) chore(v2): upgrade example projects ([@slorber](https://github.com/slorber))
- [#4398](https://github.com/facebook/docusaurus/pull/4398) chore(v1): trigger v1 site deploy through CI ([@slorber](https://github.com/slorber))
- `docusaurus-utils`
- [#4384](https://github.com/facebook/docusaurus/pull/4384) chore(v2): avoid bad publish of intl-locales-supported ([@lex111](https://github.com/lex111))

#### Committers: 14

- Alexey Pyltsyn ([@lex111](https://github.com/lex111))
- Armano ([@armano2](https://github.com/armano2))
- Harvtronix ([@Harvtronix](https://github.com/Harvtronix))
- Joon-Ha Lee ([@koko8829](https://github.com/koko8829))
- Leandro Oriente ([@leandrooriente](https://github.com/leandrooriente))
- Long Ho ([@longlho](https://github.com/longlho))
- Lowen ([@lowenhere](https://github.com/lowenhere))
- Pierre-Gilles Leymarie ([@Pierre-Gilles](https://github.com/Pierre-Gilles))
- Quan ([@quanengineering](https://github.com/quanengineering))
- Simen Bekkhus ([@SimenB](https://github.com/SimenB))
- Steven Hansel ([@ShinteiMai](https://github.com/ShinteiMai))
- Sébastien Lorber ([@slorber](https://github.com/slorber))
- Zoltan Kochan ([@zkochan](https://github.com/zkochan))
- [@Rhodanthe1116](https://github.com/Rhodanthe1116)

## 2.0.0-alpha.71 (2021-03-09)

#### :rocket: New Feature
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-1.x/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus",
"description": "Easy to Maintain Open Source Documentation Websites",
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"private_comment": "MADE PRIVATE ON PURPOSE! READ V1 PUBLISH GUIDE",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-cssnano-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/cssnano-preset",
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"description": "Advanced cssnano preset for maximum optimization.",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-init-1.x/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus-init",
"description": "Initialization script for Docusaurus",
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"private_comment": "MADE PRIVATE ON PURPOSE! READ V1 PUBLISH GUIDE",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-init/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/init",
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"description": "Create Docusaurus apps easily.",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-init/templates/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-bootstrap-template",
"version": "2.0.0-alpha.71",
"version": "2.0.0-alpha.72",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.71",
"@docusaurus/preset-bootstrap": "2.0.0-alpha.71",
"@docusaurus/core": "2.0.0-alpha.72",
"@docusaurus/preset-bootstrap": "2.0.0-alpha.72",
"@mdx-js/react": "^1.5.8",
"classnames": "^2.2.6",
"react": "^17.0.1",
Expand Down
19 changes: 19 additions & 0 deletions packages/docusaurus-init/templates/classic/docs/congratulations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Congratulations!
---

Congratulations on making it this far!

You have learned the **basics of Docusaurus** and made some changes to the **initial template**.

Docusaurus has **much more to offer**!

Have 5 more minutes? Take a look at **[versioning](./manage-docs-versions.md)** and **[i18n](./translate-your-site.md)**.

## What's next?

- Read the [official documentation](https://v2.docusaurus.io/).
- Add a custom [Design and Layout](https://v2.docusaurus.io/docs/styling-layout)
- Add a [search bar](https://v2.docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://v2.docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://v2.docusaurus.io/community/support)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Create a Blog Post
---

This page will help you on how to create blog posts in Docusaurus.
Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...

## Create a Blog Post

Expand All @@ -15,6 +15,7 @@ author: Steven Hansel
author_title: Docusaurus Contributor
author_url: https://github.com/ShinteiMai
author_image_url: https://github.com/ShinteiMai.png
tags: [greetings]
---

Congratulations, you have made your first post!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Create a Document
---

Documents are pages with a **sidebar**, a **previous/next navigation** and many other useful features.
Documents are a **group of pages** connected through a **sidebar**, a **previous/next navigation** and **versioning**.

## Create a Document

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Create a Page
---

Any React or Markdown file created under `src/pages` directory is converted into a website page:
Add **Markdown or React** files to `src/pages` to create **standalone pages**:

- `src/pages/index.js` -> `localhost:3000/`
- `src/pages/foo.md` -> `localhost:3000/foo`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Deploy your site
---

Docusaurus is a **static-site-generator** (also called [Jamstack](https://jamstack.org/)), and builds your site as **static HTML, JavaScript and CSS files**.

## Build your site

Build your site **for production**:

```bash
npm run build
```

The static files are generated in the `build` directory.

## Deploy your site

Test your production build locally:

```bash
npm run serve
```

The `build` folder is now served at `http://localhost:3000/`.

You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://v2.docusaurus.io/docs/deployment)**).
18 changes: 10 additions & 8 deletions packages/docusaurus-init/templates/classic/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ title: Getting Started
slug: /
---

## Step 1: Generate a new Docusaurus site
Get started by **creating a new site**

If you haven't already, generate a new Docusaurus site using the classic template:
Or **try Docusaurus immediately** with **[new.docusaurus.io](https://new.docusaurus.io)** (CodeSandbox).

## Generate a new site

Generate a new Docusaurus site using the **classic template**:

```shell
npx @docusaurus/init@latest init my-website classic
```

## Step 2: Start your Docusaurus site
## Start your site

Run the development server in the newly created `my-website` folder:
Run the development server:

```shell
cd my-website

npx docusaurus start
```

Open `docs/getting-started.md` and edit some lines. The site reloads automatically and display your changes.

## That's it!
Your site starts at `http://localhost:3000`.

Congratulations! You've successfully run and modified your Docusaurus project.
Open `docs/getting-started.md` and edit some lines: the site **reloads automatically** and display your changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Manage Docs Versions
---

Docusaurus can manage multiple versions of your docs.

## Create a docs version

Release a version 1.0 of your project:

```bash
npm run docusaurus docs:version 1.0
```

The `docs` directory is copied into `versioned_docs/version-1.0` and `versions.json` is created.

Your docs now have 2 versions:

- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**

## Add a Version Dropdown

To navigate seamlessly across versions, add a version dropdown.

Modify the `docusaurus.config.js` file:

```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
},
// highlight-end
],
},
},
};
```

The docs version dropdown appears in your navbar:

![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png)

## Update an existing version

It is possible to edit versioned docs in their respective folder:

- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`
Loading

0 comments on commit 10502d3

Please sign in to comment.