sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
863 stars 43 forks source link

Configuration could not be parsed #97

Closed jeremyikwuje closed 8 months ago

jeremyikwuje commented 8 months ago

I have an existing Sveltekit project using Netlfiy CMS. But recently switched to Cloudflare pages, so I tried migrating to Sveltia and Sveltia auth.

However, I keep getting the error when I access the page /admin via a browser:

The Configuration could not be parsed. Please try again later.

Here is my configuration:

 backend:
  name: github
  repo: "jeremyikwuje/sveltia-cms-auth"
  branch: main
  base_url: "sveltia-cms-auth.monierate.workers.dev"

# This line should *not* be indented
publish_mode: editorial_workflow

# These lines should *not* be indented
media_folder: "static/uploads" # Media files will be stored in the repo under static/uploads
public_folder: "/uploads" # The src attribute for uploaded media will begin with /uploads

collections:
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Blog" # Used in the UI
    folder: "src/blog" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    publish: true # Allow users to publish
    slug: "{{slug}}" # Filename template, e.g., title.md
    fields: # The fields for each document, usually in front matter
      - {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Description", name: "description", widget: "string"}
      - {label: "Publish Date", name: "createdAt", widget: "datetime"}
      - {label: "Updated At", name: "updatedAt", widget: "datetime"}
      - {label: "Tags", name: "tag", widget: "string"}
      - {label: "Featured Image", name: "image", widget: "image"}
      - {label: "Published", name: "published", widget: "boolean"}
      - {label: "Body", name: "body", widget: "markdown"}

Need help on this.

kyoshino commented 8 months ago

Hey @jeremyikwuje, thanks for checking out Sveltia CMS! I think your site is https://monierate.com/admin/ right?

I just checked the config and found an extra space before backend. Removing it solves the YAML parse error. (I’ll improve the Sveltia code to output more details in the browser console.)

Other than that, I think the repo and base_url have to be fixed. Try this:

backend:
  name: github
  repo: jeremyikwuje/monierate-website
  branch: main
  base_url: https://sveltia-cms-auth.monierate.workers.dev