This guide instructs you on how to integrate Simple CMS with Docusaurus.
### Before you begin
* Sign up for [GitHub](www.github.com) and [Netlify](www.netlify.com).
* Download [Node.js](https://nodejs.org/en/download/) version 14 or above.
* Install the [GitHub CLI](https://cli.github.com/).
* Install and authenticate the [Netlify CLI](https://docs.netlify.com/cli/get-started/).
## Create a new Docusaurus project
```bash
# 1. Use Docusaurus to create a site scaffold.
npx create-docusaurus@latest my-website classic
# 2. Run the development server.
cd my-website
npm run start
```
A browser window opens at `http://localhost:3000`.
The development server now serves your website at `http://localhost:3000`. As you edit the source files in `/my-website/`, you can visit `http://localhost:3000` to preview your changes.
Simple CMS requires a [backend](https://www.simplecms.github.io/simple-cms/docs/backends-overview/) to store content. Simple CMS supports using Git hosts, like GitHub or GitLab, as backends. This guide uses GitHub.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat.
```
</li>
</ol>
### Procedure
<ol>
<li> Create an <code>admin</code> directory inside <code>static</code>.
```bash
cd static
mkdir admin
```
</li>
<li> In the <code>admin</code> directory, create a <code>config.yml</code> file and an <code>index.html</code> file.
```bash
cd admin
touch config.yml
touch index.html
```
</li>
<li> Edit <code>index.html</code> to look like this:
`config.yml` specifies what kind of content your blog posts have. The content specification enables Simple CMS to edit existing posts and create new ones with the same format. To learn more, read about Simple CMS' [](https://www.simplecms.github.io/simple-cms/docs/configuration-options/)[Configuration options](https://www.simplecms.github.io/simple-cms/docs/configuration-options/).
You can now view and edit `2021-11-15-first-blog-post.md` through the admin interface. You can also create new blog posts.
**Warning:** Any changes you publish through the admin interface will only effect your *remote GitHub repository*. To retrieve these changes locally, `git pull` from your local repository.
</li>
<li> Commit and push your new changes to your remote repository.
```bash
git add .
git commit -m "Add Simple CMS"
git push
```
Netlify builds and deploys your new changes.
</li>
</ol>
## Add GitHub as an authentication provider
Before you can access `/admin/` through your Netlify domain, you need to set up an authentication provider. The authentication provider allows Simple CMS to determine whether users have read and write access to `/admin/`. This guide uses GitHub credentials for authentication.
### Configure GitHub
1. Create a new [GitHub OAuth application](https://github.com/settings/applications/new).
2. Enter your Netlify domain as the **Homepage URL**.
3. Enter <code>https://api.netlify.com/auth/done</code> as the **Authorization callback URL**.
4. Click **Register application.**
5. Click **Generate a new client secret.**
6. Copy the provided client secret and client ID.
### Configure Netlify
1. On Netlify, under `Site Settings > Access control > OAuth > Authentication Providers`, click **Install provider**.
2. Enter your client secret and client ID from GitHub.
3. Click **Install**.
🎉 All done! Now you can access the admin interface through your Netlify URL.