|
| 1 | +This website was created with [Docusaurus](https://docusaurus.io/). |
| 2 | + |
| 3 | +# What's In This Document |
| 4 | + |
| 5 | +* [Get Started in 5 Minutes](#get-started-in-5-minutes) |
| 6 | +* [Directory Structure](#directory-structure) |
| 7 | +* [Editing Content](#editing-content) |
| 8 | +* [Adding Content](#adding-content) |
| 9 | +* [Full Documentation](#full-documentation) |
| 10 | + |
| 11 | +# Get Started in 5 Minutes |
| 12 | + |
| 13 | +1. Make sure all the dependencies for the website are installed: |
| 14 | + |
| 15 | +```sh |
| 16 | +# Install dependencies |
| 17 | +$ yarn |
| 18 | +``` |
| 19 | +2. Run your dev server: |
| 20 | + |
| 21 | +```sh |
| 22 | +# Start the site |
| 23 | +$ yarn start |
| 24 | +``` |
| 25 | + |
| 26 | +## Directory Structure |
| 27 | + |
| 28 | +Your project file structure should look something like this |
| 29 | + |
| 30 | +``` |
| 31 | +my-docusaurus/ |
| 32 | + docs/ |
| 33 | + doc-1.md |
| 34 | + doc-2.md |
| 35 | + doc-3.md |
| 36 | + website/ |
| 37 | + blog/ |
| 38 | + 2016-3-11-oldest-post.md |
| 39 | + 2017-10-24-newest-post.md |
| 40 | + core/ |
| 41 | + node_modules/ |
| 42 | + pages/ |
| 43 | + static/ |
| 44 | + css/ |
| 45 | + img/ |
| 46 | + package.json |
| 47 | + sidebar.json |
| 48 | + siteConfig.js |
| 49 | +``` |
| 50 | + |
| 51 | +# Editing Content |
| 52 | + |
| 53 | +## Editing an existing docs page |
| 54 | + |
| 55 | +Edit docs by navigating to `docs/` and editing the corresponding document: |
| 56 | + |
| 57 | +`docs/doc-to-be-edited.md` |
| 58 | + |
| 59 | +```markdown |
| 60 | +--- |
| 61 | +id: page-needs-edit |
| 62 | +title: This Doc Needs To Be Edited |
| 63 | +--- |
| 64 | + |
| 65 | +Edit me... |
| 66 | +``` |
| 67 | + |
| 68 | +For more information about docs, click [here](https://docusaurus.io/docs/en/navigation) |
| 69 | + |
| 70 | +## Editing an existing blog post |
| 71 | + |
| 72 | +Edit blog posts by navigating to `website/blog` and editing the corresponding post: |
| 73 | + |
| 74 | +`website/blog/post-to-be-edited.md` |
| 75 | +```markdown |
| 76 | +--- |
| 77 | +id: post-needs-edit |
| 78 | +title: This Blog Post Needs To Be Edited |
| 79 | +--- |
| 80 | + |
| 81 | +Edit me... |
| 82 | +``` |
| 83 | + |
| 84 | +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) |
| 85 | + |
| 86 | +# Adding Content |
| 87 | + |
| 88 | +## Adding a new docs page to an existing sidebar |
| 89 | + |
| 90 | +1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`: |
| 91 | + |
| 92 | +```md |
| 93 | +--- |
| 94 | +id: newly-created-doc |
| 95 | +title: This Doc Needs To Be Edited |
| 96 | +--- |
| 97 | + |
| 98 | +My new content here.. |
| 99 | +``` |
| 100 | + |
| 101 | +1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`: |
| 102 | + |
| 103 | +```javascript |
| 104 | +// Add newly-created-doc to the Getting Started category of docs |
| 105 | +{ |
| 106 | + "docs": { |
| 107 | + "Getting Started": [ |
| 108 | + "quick-start", |
| 109 | + "newly-created-doc" // new doc here |
| 110 | + ], |
| 111 | + ... |
| 112 | + }, |
| 113 | + ... |
| 114 | +} |
| 115 | +``` |
| 116 | + |
| 117 | +For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation) |
| 118 | + |
| 119 | +## Adding a new blog post |
| 120 | + |
| 121 | +1. Make sure there is a header link to your blog in `website/siteConfig.js`: |
| 122 | + |
| 123 | +`website/siteConfig.js` |
| 124 | +```javascript |
| 125 | +headerLinks: [ |
| 126 | + ... |
| 127 | + { blog: true, label: 'Blog' }, |
| 128 | + ... |
| 129 | +] |
| 130 | +``` |
| 131 | + |
| 132 | +2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`: |
| 133 | + |
| 134 | +`website/blog/2018-05-21-New-Blog-Post.md` |
| 135 | + |
| 136 | +```markdown |
| 137 | +--- |
| 138 | +author: Frank Li |
| 139 | +authorURL: https://twitter.com/foobarbaz |
| 140 | +authorFBID: 503283835 |
| 141 | +title: New Blog Post |
| 142 | +--- |
| 143 | + |
| 144 | +Lorem Ipsum... |
| 145 | +``` |
| 146 | + |
| 147 | +For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) |
| 148 | + |
| 149 | +## Adding items to your site's top navigation bar |
| 150 | + |
| 151 | +1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: |
| 152 | + |
| 153 | +`website/siteConfig.js` |
| 154 | +```javascript |
| 155 | +{ |
| 156 | + headerLinks: [ |
| 157 | + ... |
| 158 | + /* you can add docs */ |
| 159 | + { doc: 'my-examples', label: 'Examples' }, |
| 160 | + /* you can add custom pages */ |
| 161 | + { page: 'help', label: 'Help' }, |
| 162 | + /* you can add external links */ |
| 163 | + { href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' }, |
| 164 | + ... |
| 165 | + ], |
| 166 | + ... |
| 167 | +} |
| 168 | +``` |
| 169 | + |
| 170 | +For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation) |
| 171 | + |
| 172 | +## Adding custom pages |
| 173 | + |
| 174 | +1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`: |
| 175 | +1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: |
| 176 | + |
| 177 | +`website/siteConfig.js` |
| 178 | +```javascript |
| 179 | +{ |
| 180 | + headerLinks: [ |
| 181 | + ... |
| 182 | + { page: 'my-new-custom-page', label: 'My New Custom Page' }, |
| 183 | + ... |
| 184 | + ], |
| 185 | + ... |
| 186 | +} |
| 187 | +``` |
| 188 | + |
| 189 | +For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages). |
| 190 | + |
| 191 | +# Full Documentation |
| 192 | + |
| 193 | +Full documentation can be found on the [website](https://docusaurus.io/). |
0 commit comments