create-docusaurus 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +23 -7
  2. package/bin/index.js +56 -1
  3. package/lib/.tsbuildinfo +1 -0
  4. package/lib/index.d.ts +11 -0
  5. package/lib/index.js +235 -0
  6. package/package.json +18 -3
  7. package/src/index.ts +289 -0
  8. package/templates/README.md +8 -0
  9. package/templates/bootstrap/docusaurus.config.js +93 -0
  10. package/templates/bootstrap/package.json +39 -0
  11. package/templates/bootstrap/src/pages/index.js +87 -0
  12. package/templates/bootstrap/src/pages/styles.module.css +49 -0
  13. package/templates/classic/docusaurus.config.js +118 -0
  14. package/templates/classic/package.json +40 -0
  15. package/templates/classic/src/components/HomepageFeatures.js +64 -0
  16. package/templates/classic/src/components/HomepageFeatures.module.css +11 -0
  17. package/templates/classic/src/css/custom.css +28 -0
  18. package/templates/classic/src/pages/index.js +40 -0
  19. package/templates/classic/src/pages/index.module.css +23 -0
  20. package/templates/classic-typescript/package.json +46 -0
  21. package/templates/classic-typescript/src/components/HomepageFeatures.tsx +76 -0
  22. package/templates/classic-typescript/src/pages/index.tsx +40 -0
  23. package/templates/classic-typescript/tsconfig.json +7 -0
  24. package/templates/facebook/.eslintrc.js +60 -0
  25. package/templates/facebook/.prettierignore +3 -0
  26. package/templates/facebook/.prettierrc +9 -0
  27. package/templates/facebook/.stylelintrc.js +13 -0
  28. package/templates/facebook/README.md +41 -0
  29. package/templates/facebook/babel.config.js +12 -0
  30. package/templates/facebook/docusaurus.config.js +152 -0
  31. package/templates/facebook/gitignore +23 -0
  32. package/templates/facebook/package.json +56 -0
  33. package/templates/facebook/sidebars.js +35 -0
  34. package/templates/facebook/src/css/custom.css +33 -0
  35. package/templates/facebook/src/pages/index.js +109 -0
  36. package/templates/facebook/src/pages/styles.module.css +44 -0
  37. package/templates/facebook/static/img/oss_logo.png +0 -0
  38. package/templates/shared/README.md +33 -0
  39. package/templates/shared/babel.config.js +3 -0
  40. package/templates/shared/blog/2019-05-28-first-blog-post.md +12 -0
  41. package/templates/shared/blog/2019-05-29-long-blog-post.md +44 -0
  42. package/templates/shared/blog/2021-08-01-mdx-blog-post.mdx +20 -0
  43. package/templates/shared/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
  44. package/templates/shared/blog/2021-08-26-welcome/index.md +25 -0
  45. package/templates/shared/blog/authors.yml +17 -0
  46. package/templates/shared/docs/intro.md +35 -0
  47. package/templates/shared/docs/tutorial-basics/_category_.json +4 -0
  48. package/templates/shared/docs/tutorial-basics/congratulations.md +21 -0
  49. package/templates/shared/docs/tutorial-basics/create-a-blog-post.md +34 -0
  50. package/templates/shared/docs/tutorial-basics/create-a-document.md +55 -0
  51. package/templates/shared/docs/tutorial-basics/create-a-page.md +43 -0
  52. package/templates/shared/docs/tutorial-basics/deploy-your-site.md +31 -0
  53. package/templates/shared/docs/tutorial-basics/markdown-features.mdx +144 -0
  54. package/templates/shared/docs/tutorial-extras/_category_.json +4 -0
  55. package/templates/shared/docs/tutorial-extras/manage-docs-versions.md +55 -0
  56. package/templates/shared/docs/tutorial-extras/translate-your-site.md +88 -0
  57. package/templates/shared/gitignore +20 -0
  58. package/templates/shared/sidebars.js +26 -0
  59. package/templates/shared/src/pages/markdown-page.md +7 -0
  60. package/templates/shared/static/.nojekyll +0 -0
  61. package/templates/shared/static/img/docusaurus.png +0 -0
  62. package/templates/shared/static/img/favicon.ico +0 -0
  63. package/templates/shared/static/img/logo.svg +1 -0
  64. package/templates/shared/static/img/tutorial/docsVersionDropdown.png +0 -0
  65. package/templates/shared/static/img/tutorial/localeDropdown.png +0 -0
  66. package/templates/shared/static/img/undraw_docusaurus_mountain.svg +170 -0
  67. package/templates/shared/static/img/undraw_docusaurus_react.svg +169 -0
  68. package/templates/shared/static/img/undraw_docusaurus_tree.svg +1 -0
  69. package/tsconfig.json +11 -0
@@ -0,0 +1,23 @@
1
+ # Dependencies
2
+ /node_modules
3
+
4
+ # Production
5
+ /build
6
+
7
+ # Generated files
8
+ .docusaurus
9
+ .cache-loader
10
+
11
+ # Misc
12
+ .DS_Store
13
+ .env.local
14
+ .env.development.local
15
+ .env.test.local
16
+ .env.production.local
17
+
18
+ npm-debug.log*
19
+ yarn-debug.log*
20
+ yarn-error.log*
21
+
22
+ # ESLint
23
+ .eslintcache
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "docusaurus-2-facebook-template",
3
+ "version": "2.0.0-beta.6",
4
+ "private": true,
5
+ "scripts": {
6
+ "docusaurus": "docusaurus",
7
+ "start": "docusaurus start",
8
+ "build": "docusaurus build",
9
+ "swizzle": "docusaurus swizzle",
10
+ "deploy": "docusaurus deploy",
11
+ "clear": "docusaurus clear",
12
+ "serve": "docusaurus serve",
13
+ "write-translations": "docusaurus write-translations",
14
+ "write-heading-ids": "docusaurus write-heading-ids",
15
+ "ci": "yarn lint && yarn prettier:diff",
16
+ "lint": "eslint --cache \"**/*.js\" && stylelint \"**/*.css\"",
17
+ "prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
18
+ "prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
19
+ },
20
+ "dependencies": {
21
+ "@docusaurus/core": "2.0.0-beta.6",
22
+ "@docusaurus/preset-classic": "2.0.0-beta.6",
23
+ "@mdx-js/react": "^1.6.21",
24
+ "@svgr/webpack": "^5.5.0",
25
+ "clsx": "^1.1.1",
26
+ "file-loader": "^6.2.0",
27
+ "react": "^17.0.1",
28
+ "react-dom": "^17.0.1",
29
+ "url-loader": "^4.1.1"
30
+ },
31
+ "devDependencies": {
32
+ "@babel/eslint-parser": "^7.15.7",
33
+ "eslint": "^7.20.0",
34
+ "eslint-config-airbnb": "^18.2.1",
35
+ "eslint-config-prettier": "^6.15.0",
36
+ "eslint-plugin-header": "^3.0.0",
37
+ "eslint-plugin-import": "^2.22.1",
38
+ "eslint-plugin-jsx-a11y": "^6.4.1",
39
+ "eslint-plugin-react": "^7.21.5",
40
+ "eslint-plugin-react-hooks": "^4.2.0",
41
+ "prettier": "^2.2.1",
42
+ "stylelint": "^13.2.1"
43
+ },
44
+ "browserslist": {
45
+ "production": [
46
+ ">0.5%",
47
+ "not dead",
48
+ "not op_mini all"
49
+ ],
50
+ "development": [
51
+ "last 1 chrome version",
52
+ "last 1 firefox version",
53
+ "last 1 safari version"
54
+ ]
55
+ }
56
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ /**
11
+ * Creating a sidebar enables you to:
12
+ - create an ordered group of docs
13
+ - render a sidebar for each doc of that group
14
+ - provide next/previous navigation
15
+
16
+ The sidebars can be generated from the filesystem, or explicitly defined here.
17
+
18
+ Create as many sidebars as you want.
19
+ */
20
+
21
+ module.exports = {
22
+ // By default, Docusaurus generates a sidebar from the docs folder structure
23
+ tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
24
+
25
+ // But you can create a sidebar manually
26
+ /*
27
+ tutorialSidebar: [
28
+ {
29
+ type: 'category',
30
+ label: 'Tutorial',
31
+ items: ['hello'],
32
+ },
33
+ ],
34
+ */
35
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ /**
11
+ * Any CSS included here will be global. The classic template
12
+ * bundles Infima by default. Infima is a CSS framework designed to
13
+ * work well for content-centric websites.
14
+ */
15
+
16
+ /* You can override the default Infima variables here. */
17
+ :root {
18
+ --ifm-color-primary: #25c2a0;
19
+ --ifm-color-primary-dark: rgb(33, 175, 144);
20
+ --ifm-color-primary-darker: rgb(31, 165, 136);
21
+ --ifm-color-primary-darkest: rgb(26, 136, 112);
22
+ --ifm-color-primary-light: rgb(70, 203, 174);
23
+ --ifm-color-primary-lighter: rgb(102, 212, 189);
24
+ --ifm-color-primary-lightest: rgb(146, 224, 208);
25
+ --ifm-code-font-size: 95%;
26
+ }
27
+
28
+ .docusaurus-highlight-code-line {
29
+ background-color: rgb(72, 77, 91);
30
+ display: block;
31
+ margin: 0 calc(-1 * var(--ifm-pre-padding));
32
+ padding: 0 var(--ifm-pre-padding);
33
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ import React from 'react';
11
+ import clsx from 'clsx';
12
+ import Layout from '@theme/Layout';
13
+ import Link from '@docusaurus/Link';
14
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
15
+ import useBaseUrl from '@docusaurus/useBaseUrl';
16
+ import styles from './styles.module.css';
17
+
18
+ const features = [
19
+ {
20
+ title: 'Easy to Use',
21
+ imageUrl: 'img/undraw_docusaurus_mountain.svg',
22
+ description: (
23
+ <>
24
+ Docusaurus was designed from the ground up to be easily installed and
25
+ used to get your website up and running quickly.
26
+ </>
27
+ ),
28
+ },
29
+ {
30
+ title: 'Focus on What Matters',
31
+ imageUrl: 'img/undraw_docusaurus_tree.svg',
32
+ description: (
33
+ <>
34
+ Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
35
+ ahead and move your docs into the <code>docs</code> directory.
36
+ </>
37
+ ),
38
+ },
39
+ {
40
+ title: 'Powered by React',
41
+ imageUrl: 'img/undraw_docusaurus_react.svg',
42
+ description: (
43
+ <>
44
+ Extend or customize your website layout by reusing React. Docusaurus can
45
+ be extended while reusing the same header and footer.
46
+ </>
47
+ ),
48
+ },
49
+ ];
50
+
51
+ function Feature({imageUrl, title, description}) {
52
+ const imgUrl = useBaseUrl(imageUrl);
53
+ return (
54
+ <div className={clsx('col col--4', styles.feature)}>
55
+ {imgUrl && (
56
+ <div className="text--center">
57
+ <img className={styles.featureImage} src={imgUrl} alt={title} />
58
+ </div>
59
+ )}
60
+ <h3>{title}</h3>
61
+ <p>{description}</p>
62
+ </div>
63
+ );
64
+ }
65
+
66
+ export default function Home() {
67
+ const context = useDocusaurusContext();
68
+ const {siteConfig = {}} = context;
69
+ return (
70
+ <Layout
71
+ title={`Hello from ${siteConfig.title}`}
72
+ description="Description will go into a meta tag in <head />">
73
+ <header className={clsx('hero hero--primary', styles.heroBanner)}>
74
+ <div className="container">
75
+ <h1 className="hero__title">{siteConfig.title}</h1>
76
+ <p className="hero__subtitle">{siteConfig.tagline}</p>
77
+ <div className={styles.buttons}>
78
+ <Link
79
+ className={clsx(
80
+ 'button button--outline button--secondary button--lg',
81
+ styles.getStarted,
82
+ )}
83
+ to={useBaseUrl('docs/')}>
84
+ Get Started
85
+ </Link>
86
+ </div>
87
+ </div>
88
+ </header>
89
+ <main>
90
+ {features && features.length > 0 && (
91
+ <section className={styles.features}>
92
+ <div className="container">
93
+ <div className="row">
94
+ {features.map(({title, imageUrl, description}) => (
95
+ <Feature
96
+ key={title}
97
+ title={title}
98
+ imageUrl={imageUrl}
99
+ description={description}
100
+ />
101
+ ))}
102
+ </div>
103
+ </div>
104
+ </section>
105
+ )}
106
+ </main>
107
+ </Layout>
108
+ );
109
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ /**
11
+ * CSS files with the .module.css suffix will be treated as CSS modules
12
+ * and scoped locally.
13
+ */
14
+
15
+ .heroBanner {
16
+ padding: 4rem 0;
17
+ text-align: center;
18
+ position: relative;
19
+ overflow: hidden;
20
+ }
21
+
22
+ @media screen and (max-width: 966px) {
23
+ .heroBanner {
24
+ padding: 2rem;
25
+ }
26
+ }
27
+
28
+ .buttons {
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ }
33
+
34
+ .features {
35
+ display: flex;
36
+ align-items: center;
37
+ padding: 2rem 0;
38
+ width: 100%;
39
+ }
40
+
41
+ .featureImage {
42
+ height: 200px;
43
+ width: 200px;
44
+ }
@@ -0,0 +1,33 @@
1
+ # Website
2
+
3
+ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4
+
5
+ ### Installation
6
+
7
+ ```
8
+ $ yarn
9
+ ```
10
+
11
+ ### Local Development
12
+
13
+ ```
14
+ $ yarn start
15
+ ```
16
+
17
+ This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18
+
19
+ ### Build
20
+
21
+ ```
22
+ $ yarn build
23
+ ```
24
+
25
+ This command generates static content into the `build` directory and can be served using any static contents hosting service.
26
+
27
+ ### Deployment
28
+
29
+ ```
30
+ $ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31
+ ```
32
+
33
+ If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3
+ };
@@ -0,0 +1,12 @@
1
+ ---
2
+ slug: first-blog-post
3
+ title: First Blog Post
4
+ authors:
5
+ name: Gao Wei
6
+ title: Docusaurus Core Team
7
+ url: https://github.com/wgao19
8
+ image_url: https://github.com/wgao19.png
9
+ tags: [hola, docusaurus]
10
+ ---
11
+
12
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
@@ -0,0 +1,44 @@
1
+ ---
2
+ slug: long-blog-post
3
+ title: Long Blog Post
4
+ authors: endi
5
+ tags: [hello, docusaurus]
6
+ ---
7
+
8
+ This is the summary of a very long blog post,
9
+
10
+ Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
11
+
12
+ <!--truncate-->
13
+
14
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
15
+
16
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
17
+
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
19
+
20
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
21
+
22
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
23
+
24
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
25
+
26
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
27
+
28
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
29
+
30
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
31
+
32
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
33
+
34
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
35
+
36
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
37
+
38
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
39
+
40
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
41
+
42
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
43
+
44
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
@@ -0,0 +1,20 @@
1
+ ---
2
+ slug: mdx-blog-post
3
+ title: MDX Blog Post
4
+ authors: [slorber]
5
+ tags: [docusaurus]
6
+ ---
7
+
8
+ Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
9
+
10
+ :::tip
11
+
12
+ Use the power of React to create interactive blog posts.
13
+
14
+ ```js
15
+ <button onClick={() => alert('button clicked!')}>Click me!</button>
16
+ ```
17
+
18
+ <button onClick={() => alert('button clicked!')}>Click me!</button>
19
+
20
+ :::
@@ -0,0 +1,25 @@
1
+ ---
2
+ slug: welcome
3
+ title: Welcome
4
+ authors: [slorber, yangshun]
5
+ tags: [facebook, hello, docusaurus]
6
+ ---
7
+
8
+ [Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
9
+
10
+ Simply add Markdown files (or folders) to the `blog` directory.
11
+
12
+ Regular blog authors can be added to `authors.yml`.
13
+
14
+ The blog post date can be extracted from filenames, such as:
15
+
16
+ - `2019-05-30-welcome.md`
17
+ - `2019-05-30-welcome/index.md`
18
+
19
+ A blog post folder can be convenient to co-locate blog post images:
20
+
21
+ ![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)
22
+
23
+ The blog supports tags as well!
24
+
25
+ **And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
@@ -0,0 +1,17 @@
1
+ endi:
2
+ name: Endilie Yacop Sucipto
3
+ title: Maintainer of Docusaurus
4
+ url: https://github.com/endiliey
5
+ image_url: https://github.com/endiliey.png
6
+
7
+ yangshun:
8
+ name: Yangshun Tay
9
+ title: Front End Engineer @ Facebook
10
+ url: https://github.com/yangshun
11
+ image_url: https://github.com/yangshun.png
12
+
13
+ slorber:
14
+ name: Sébastien Lorber
15
+ title: Docusaurus maintainer
16
+ url: https://sebastienlorber.com
17
+ image_url: https://github.com/slorber.png
@@ -0,0 +1,35 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Tutorial Intro
6
+
7
+ Let's discover **Docusaurus in less than 5 minutes**.
8
+
9
+ ## Getting Started
10
+
11
+ Get started by **creating a new site**.
12
+
13
+ Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14
+
15
+ ## Generate a new site
16
+
17
+ Generate a new Docusaurus site using the **classic template**:
18
+
19
+ ```shell
20
+ npx @docusaurus/init@latest init my-website classic
21
+ ```
22
+
23
+ ## Start your site
24
+
25
+ Run the development server:
26
+
27
+ ```shell
28
+ cd my-website
29
+
30
+ npx docusaurus start
31
+ ```
32
+
33
+ Your site starts at `http://localhost:3000`.
34
+
35
+ Open `docs/intro.md` and edit some lines: the site **reloads automatically** and display your changes.
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Tutorial - Basics",
3
+ "position": 2
4
+ }
@@ -0,0 +1,21 @@
1
+ ---
2
+ sidebar_position: 6
3
+ ---
4
+
5
+ # Congratulations!
6
+
7
+ You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.
8
+
9
+ Docusaurus has **much more to offer**!
10
+
11
+ Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.
12
+
13
+ Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)
14
+
15
+ ## What's next?
16
+
17
+ - Read the [official documentation](https://docusaurus.io/).
18
+ - Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
19
+ - Add a [search bar](https://docusaurus.io/docs/search)
20
+ - Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
21
+ - Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
@@ -0,0 +1,34 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ # Create a Blog Post
6
+
7
+ Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...
8
+
9
+ ## Create your first Post
10
+
11
+ Create a file at `blog/2021-02-28-greetings.md`:
12
+
13
+ ```md title="blog/2021-02-28-greetings.md"
14
+ ---
15
+ slug: greetings
16
+ title: Greetings!
17
+ authors:
18
+ - name: Joel Marcey
19
+ title: Co-creator of Docusaurus 1
20
+ url: https://github.com/JoelMarcey
21
+ image_url: https://github.com/JoelMarcey.png
22
+ - name: Sébastien Lorber
23
+ title: Docusaurus maintainer
24
+ url: https://sebastienlorber.com
25
+ image_url: https://github.com/slorber.png
26
+ tags: [greetings]
27
+ ---
28
+
29
+ Congratulations, you have made your first post!
30
+
31
+ Feel free to play around and edit this post as much you like.
32
+ ```
33
+
34
+ A new blog post is now available at `http://localhost:3000/blog/greetings`.
@@ -0,0 +1,55 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ # Create a Document
6
+
7
+ Documents are **groups of pages** connected through:
8
+
9
+ - a **sidebar**
10
+ - **previous/next navigation**
11
+ - **versioning**
12
+
13
+ ## Create your first Doc
14
+
15
+ Create a markdown file at `docs/hello.md`:
16
+
17
+ ```md title="docs/hello.md"
18
+ # Hello
19
+
20
+ This is my **first Docusaurus document**!
21
+ ```
22
+
23
+ A new document is now available at `http://localhost:3000/docs/hello`.
24
+
25
+ ## Configure the Sidebar
26
+
27
+ Docusaurus automatically **creates a sidebar** from the `docs` folder.
28
+
29
+ Add metadatas to customize the sidebar label and position:
30
+
31
+ ```md title="docs/hello.md" {1-4}
32
+ ---
33
+ sidebar_label: 'Hi!'
34
+ sidebar_position: 3
35
+ ---
36
+
37
+ # Hello
38
+
39
+ This is my **first Docusaurus document**!
40
+ ```
41
+
42
+ It is also possible to create your sidebar explicitly in `sidebars.js`:
43
+
44
+ ```diff title="sidebars.js"
45
+ module.exports = {
46
+ tutorialSidebar: [
47
+ {
48
+ type: 'category',
49
+ label: 'Tutorial',
50
+ - items: [...],
51
+ + items: ['hello'],
52
+ },
53
+ ],
54
+ };
55
+ ```
@@ -0,0 +1,43 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Create a Page
6
+
7
+ Add **Markdown or React** files to `src/pages` to create a **standalone page**:
8
+
9
+ - `src/pages/index.js` -> `localhost:3000/`
10
+ - `src/pages/foo.md` -> `localhost:3000/foo`
11
+ - `src/pages/foo/bar.js` -> `localhost:3000/foo/bar`
12
+
13
+ ## Create your first React Page
14
+
15
+ Create a file at `src/pages/my-react-page.js`:
16
+
17
+ ```jsx title="src/pages/my-react-page.js"
18
+ import React from 'react';
19
+ import Layout from '@theme/Layout';
20
+
21
+ export default function MyReactPage() {
22
+ return (
23
+ <Layout>
24
+ <h1>My React page</h1>
25
+ <p>This is a React page</p>
26
+ </Layout>
27
+ );
28
+ }
29
+ ```
30
+
31
+ A new page is now available at `http://localhost:3000/my-react-page`.
32
+
33
+ ## Create your first Markdown Page
34
+
35
+ Create a file at `src/pages/my-markdown-page.md`:
36
+
37
+ ```mdx title="src/pages/my-markdown-page.md"
38
+ # My Markdown page
39
+
40
+ This is a Markdown page
41
+ ```
42
+
43
+ A new page is now available at `http://localhost:3000/my-markdown-page`.