DEV Community

Discussion on: Svelte + Sapper + Netlify CMS

Collapse
 
siriusbits profile image
Benjamin Bykowski

Great post!

One thing threw me so sharing in case it helps @triptych and others:

Netlify CMS will use the title field as the slug and this will cause a JSON error as Sapper will look for a markdown file with the wrong name.

Add identifier_field: "slug" to the config.yml under collections:

collections:
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Blog" # Used in the UI
    folder: "static/posts" # The path to the folder where our blog posts are stored
    identifier_field: "slug" # Tells Netlify to use the slug field as the slug (and file name) value