medfreeman / nuxt-netlify-cms-module

Easy Netlify CMS integration with nuxt.js
MIT License
194 stars 23 forks source link

404 after refresh post #79

Closed influx-agence closed 5 years ago

influx-agence commented 6 years ago

Describe the bug Hello, That's my problem: When I go to my blog, the list of articles is displayed well. Once I go to an article and refresh the page I find a 404 error. Looking more ready the networks I realize that the .JSON normally called has two points after refreshment (Myurl.com/_nuxt/content/name..json) Someone will have an idea where it might come from? Thx for your rep :+1:

To Reproduce

  1. Go to 'https://influx-agence.netlify.com/blog/'
  2. Click on 'My second blog'
  3. Look the web console network ( 2018.premier-posts.json )
  4. Refresh page
  5. The page is 404
  6. Look web console network ( 2018.premier-posts..json )

Screenshots

  1. Before refresh image
  2. After refresh image

Applicable Versions:

CMS configuration

backend:
  name: github
  repo: influx-agence/Nuxtlify
  branch: master
media_folder: "static/uploads"
display_url: https://influx-agence.netlify.com
collections: # A list of collections the CMS should be able to edit
  - name: "blog" # Used in routes, ie.: /admin/collections/:slug/edit
    label: "Blog" # Used in the UI, ie.: "New Post"
    folder: "content/posts"
    extension: "json"
    format: "json"
    create: true
    slug: "{{year}}-{{slug}}"
    fields: # The fields each document in this collection have
      - {label: "Title", name: "title", widget: "string", tagname: "h1"}
      - {label: "Publish Date", name: "date", widget: "datetime", format: "DD-MM-YYYY"}
      - {label: "Cover Image", name: "image", widget: "image", required: false, tagname: ""}
      - {label: "Body", name: "body", widget: "markdown"}
    meta:
- {label: "SEO Description", name: "description", widget: "text"}

Additional context https://github.com/influx-agence/Nuxtlify

This question is available on Nuxt community (#c7729)
influx-agence commented 6 years ago

up

medfreeman commented 5 years ago

Hi, as said in https://github.com/nuxt-community/nuxtent-module/issues/180, it is because nuxtent doesn't support .json files.

Use markdown files with frontmatter data. Please refer to Netlify-cms configuration doc.

And also take a look at this site for an example: https://github.com/medfreeman/asso-rei.fr/blob/3ae1a8346270f9bf8e1fba79d2c6472d72e49156/src/netlify-cms/config.yml

and

https://github.com/medfreeman/asso-rei.fr/tree/3ae1a8346270f9bf8e1fba79d2c6472d72e49156/src/content/pages