Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs: Guides “nuxt” #6608

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion website/content/docs/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ npm run dev

### Add the Decap CMS files to Nuxt

For nuxt 3 apps and above use the \`public/\` folder instead of \`/static\` which is for nuxt 2.

In the `static/` directory, create a new directory `admin/`. Inside that directory you'll create two files, your `index.html` and a `config.yml`. Per the [Decap CMS documentation](/docs/add-to-your-site/), we'll set the content of `static/admin/index.html` to the following:

```html
Expand Down Expand Up @@ -107,6 +109,8 @@ Now you can go ahead and deploy to Netlify. Go to your Netlify dashboard and cli

You've already added the Netlify Identity widget to our `admin/index.html`. The next thing to do is add the Netlify Identity widget to our site's index page. In `pages/index.vue`, we can add the following to the page `<script>` tag:

#### Nuxt 2 apps:

```javascript
export default {
head() {
Expand All @@ -117,6 +121,20 @@ export default {
};
```

#### Nuxt 3 apps:

```javascript
<script setup>

useHead({
  script: [
    { src: "https://identity.netlify.com/v1/netlify-identity-widget.js" },
  ],
});

</script>
```

Once you've added this, make sure to push your changes to GitHub!

*More on adding `<script>` tags to `<head>` [here](https://nuxtjs.org/faq/#local-settings).*
Expand Down Expand Up @@ -266,4 +284,4 @@ export default {
};
```

To see the generated site, navigate to name-of-your-website.netlify.app/blog
To see the generated site, navigate to name-of-your-website.netlify.app/blog