Integrating Netlify CMS into Statiq website: config.yml not found

Hi all,
I can’t seem to get Netlify CMS to work with Statiq. When I point my browser to https://valticus.cf/admin/ , I get:
Config Errors:

Error: Failed to load config.yml (404)

Check your config.yml file.
I have the config file in both input/admin and output/admin folders, the required snippets are configured to be injected via Netlify Script Inject.

The config.yml file:

backend:
  name: git-gateway
  branch: master # Branch to update (optional; defaults to master)

media_folder: "input/images/uploads" # Media files will be stored in the repo under input/assets/Images
public_folder: "/images/uploads" # public_folder indicates where they can be found in the published site. This path is used in image src attributes and is relative to the file where its called.  https://www.netlifycms.org/docs/add-to-your-site/

collections:
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Blog" # Used in the UI
    folder: "input/posts" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
    fields: # The fields for each document, usually in front matter
      - { label: "Title", name: "Title", widget: "string" }
      - {
          label: "Lead",
          name: "Lead",
          widget: "string",
          optional: true,
          required: false,
        }
      - { label: "Published", name: "Published", widget: "datetime" }
      - {
          label: "Featured Image",
          name: "Image",
          widget: "image",
          optional: true,
          required: false,
          pattern:
            [
              '^\S*$',
              "Please rename your image remove any spaces from the filename",
            ],
        }
      - label: Tags
        name: Tags
        widget: list
      - { label: "Body", name: "body", widget: "markdown" }

If anyone has integrated Netlify CMS into Statiq.Web, please help. Thank you!

Your config.yml hasn’t been deployed, at least not in the right place (https://valticus.cf/admin/config.yml). Can you share the repo of your website?

Sure. The repo is GitHub - ValPaliy/valticus: Statiq blog
I have also tweaked a few things after reading this article Mark Burton - Setting up NetlifyCMS with Wyam - Part 1 but the results are the same so far.

So, I have moved the config file to root, creating an injection snippet

<link href="config.yml" type="text/yaml" rel="cms-config-url">

Still nothing.

So, I have decided to remove Netlify CMS until Statiq is fully supported. Thankk you very much, @tomrutgers for trying to help, but no matter where I put the config.yml, it is invisible to the CMS after I push changes ¯_(ツ)_/¯

I can’t wrap my head around it. It’s quite unclear how static is handling files from input to output.

You could try manual init within your index, add your config from js in a script tag:

That way adding a single index.html file is enough

@tomrutgers yeah, neither can I. Spent almost whole day today trying different things. Will try what you had suggested too. Thank you very much!

2 Likes

Hey there, @ValPaliy :wave:

Please report back once you try @tomrutgers solution so that we know if it works! :slight_smile: Thanks both for some awesome collaboration here!