From 49bed27aa8a19fe28ed215b2940b90024f3428ab Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Thu, 22 Dec 2022 12:28:51 -0500 Subject: [PATCH] Update CDN docs --- .../content/docs/add-to-your-site-cdn.mdx | 4 +- .../docs/content/docs/custom-previews.mdx | 2 +- packages/docs/content/docs/custom-widgets.mdx | 2 +- packages/docs/content/docs/docusaurus.mdx | 50 +++++++++---------- packages/docs/content/docs/hugo.mdx | 2 +- packages/docs/content/docs/jekyll.mdx | 2 +- packages/docs/content/docs/middleman.mdx | 6 +-- packages/docs/content/docs/nextjs.mdx | 2 +- packages/docs/content/docs/nuxt.mdx | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/docs/content/docs/add-to-your-site-cdn.mdx b/packages/docs/content/docs/add-to-your-site-cdn.mdx index c7b19573..b1916ffe 100644 --- a/packages/docs/content/docs/add-to-your-site-cdn.mdx +++ b/packages/docs/content/docs/add-to-your-site-cdn.mdx @@ -49,7 +49,7 @@ In this example, we pull the `admin/index.html` file from a public CDN. - + @@ -57,7 +57,7 @@ In this example, we pull the `admin/index.html` file from a public CDN. ``` -In the code above the `script` is loaded from the `unpkg` CDN. Should there be any issue, `jsDelivr` can be used as an alternative source. Simply set the `src` to `https://cdn.jsdelivr.net/npm/@staticcms/core@%5E1.0.0/dist/static-cms-core.js` +In the code above the `script` is loaded from the `unpkg` CDN. Should there be any issue, `jsDelivr` can be used as an alternative source. Simply set the `src` to `https://cdn.jsdelivr.net/npm/@staticcms/app@%5E1.0.0/dist/static-cms-app.js` ## Configuration diff --git a/packages/docs/content/docs/custom-previews.mdx b/packages/docs/content/docs/custom-previews.mdx index 21b89576..9667f3df 100644 --- a/packages/docs/content/docs/custom-previews.mdx +++ b/packages/docs/content/docs/custom-previews.mdx @@ -35,7 +35,7 @@ The following parameters will be passed to your `react_component` during render: ### Example ```html - + + + ``` `index.html` displays the Static CMS admin interface. You'll use the admin interface to edit your blog posts. -4. Edit `config.yml` to look like this: +4. Edit `config.yml` to look like this: ```yaml backend: name: github - branch: main + branch: main repo: /my-website - + # These lines should *not* be indented media_folder: "static/img" # Media files will be stored in the repo under static/images/uploads public_folder: "/img/" # The src attribute for uploaded media will begin with /images/uploads - + collections: - name: blog label: "blog" @@ -163,38 +163,38 @@ Your website is now deployed. Netlify provides you with a randomly generated dom name: "tags" widget: "list" - label: "Authors" - name: "authors" + name: "authors" widget: "list" fields: - { name: name, label: Name, widget: string } - - { name: title, label: Title, widget: string } - - { name: url, label: URL, widget: string } - - { name: imageUrl, label: ImageURL, widget: string } + - { name: title, label: Title, widget: string } + - { name: url, label: URL, widget: string } + - { name: imageUrl, label: ImageURL, widget: string } ``` `config.yml` specifies what kind of content your blog posts have. The content specification enables Static CMS to edit existing posts and create new ones with the same format. To learn more, read about Static CMS' [](/docs/configuration-options/)[Configuration options](/docs/configuration-options/). 5. Visit `localhost:3000/admin` - You can now view and edit `2021-11-15-first-blog-post.md` through the admin interface. You can also create new blog posts. + 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. -6. Commit and push your new changes to your remote repository. +6. Commit and push your new changes to your remote repository. ```bash - git add . + git add . git commit -m "Add Static CMS" git push ``` - Netlify builds and deploys your new changes. + Netlify builds and deploys your new changes. ## 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 Static CMS to determine whether users have read and write access to `/admin/`. This guide uses GitHub credentials for authentication. +Before you can access `/admin/` through your Netlify domain, you need to set up an authentication provider. The authentication provider allows Static CMS to determine whether users have read and write access to `/admin/`. This guide uses GitHub credentials for authentication. -### Configure GitHub +### Configure GitHub -1. Create a new [GitHub OAuth application](https://github.com/settings/applications/new). +1. Create a new [GitHub OAuth application](https://github.com/settings/applications/new). 2. Enter your Netlify domain as the **Homepage URL**. 3. Enter `https://api.netlify.com/auth/done` as the **Authorization callback URL**. 4. Click **Register application.** -5. Click **Generate a new client secret.** +5. Click **Generate a new client secret.** 6. Copy the provided client secret and client ID. ### Configure Netlify @@ -203,4 +203,4 @@ Before you can access `/admin/` through your Netlify domain, you need to set up 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. \ No newline at end of file +🎉 All done! Now you can access the admin interface through your Netlify URL. diff --git a/packages/docs/content/docs/hugo.mdx b/packages/docs/content/docs/hugo.mdx index bba0c80b..0ab1c45b 100644 --- a/packages/docs/content/docs/hugo.mdx +++ b/packages/docs/content/docs/hugo.mdx @@ -77,7 +77,7 @@ In Hugo, static files that don't need to be processed by the build commands live - + ``` diff --git a/packages/docs/content/docs/jekyll.mdx b/packages/docs/content/docs/jekyll.mdx index d4870546..47adf09d 100644 --- a/packages/docs/content/docs/jekyll.mdx +++ b/packages/docs/content/docs/jekyll.mdx @@ -37,7 +37,7 @@ Create a file `admin/index.html` in the root of your repo - it should look like - + ``` diff --git a/packages/docs/content/docs/middleman.mdx b/packages/docs/content/docs/middleman.mdx index 6f760a4e..b3b60f14 100644 --- a/packages/docs/content/docs/middleman.mdx +++ b/packages/docs/content/docs/middleman.mdx @@ -118,7 +118,7 @@ In the newly created `index.html` we add scripts for Static CMS and the Netlify - + @@ -151,7 +151,7 @@ collections: ``` ### Push to GitHub -It's now time to commit your changes and push to GitHub. +It's now time to commit your changes and push to GitHub. ```bash git init @@ -176,7 +176,7 @@ Netlify's Identity and Git Gateway services allow you to manage CMS admin users ## Start publishing -It's time to create your first blog post. Login to your site's `/admin/` page and create a new post by clicking New Blog. Add a title, a date and some text. When you click Publish, a new commit will be created in your GitHub repo with this format `Create Blog "year-month-date-title"`. +It's time to create your first blog post. Login to your site's `/admin/` page and create a new post by clicking New Blog. Add a title, a date and some text. When you click Publish, a new commit will be created in your GitHub repo with this format `Create Blog "year-month-date-title"`. Then Netlify will detect that there was a commit in your repo, and will start rebuilding your project. When your project is deployed you'll be able to see the post you created. diff --git a/packages/docs/content/docs/nextjs.mdx b/packages/docs/content/docs/nextjs.mdx index d439f0b0..d9cc450f 100644 --- a/packages/docs/content/docs/nextjs.mdx +++ b/packages/docs/content/docs/nextjs.mdx @@ -158,7 +158,7 @@ Paste HTML for Static CMS into your `public/admin/index.html` file (check out th - + ``` diff --git a/packages/docs/content/docs/nuxt.mdx b/packages/docs/content/docs/nuxt.mdx index 93e3b63c..e2fb534d 100644 --- a/packages/docs/content/docs/nuxt.mdx +++ b/packages/docs/content/docs/nuxt.mdx @@ -36,7 +36,7 @@ In the `static/` directory, create a new directory `admin/`. Inside that directo - + ```