I’ve an Eleventy site on Netlify, with source files held in src and publishing to dist. I decided to try NetlifyCMS, and add a blog. So I added a /blog folder under src and pointed the config layout to the post template.
Deployed ok, but I couldn’t get the blog to show, and I’ve many questions - wondering if anyone can provide a clue as to what should be going on.
My config.yml adds a blog collection. But where do I point the path to the folder where the documents are stored? If I point it to a /blog folder, then it writes that to my github repo in a /blog folder outside my src folder. Is this blog folder being written to my dist folder in Netlify?
I assume it can’t write to my src/blog folder, because my understanding is that Netlify isn’t processing anything after the initial build. But then for ongoing local development, do I now have to do a git pull from origin master to my local repo each time, so that I retain those blog posts? Having to do that each time I tweak my local repo would kinda give me the pips.
And how does one create the blog collection? Is it formed within the config.yml, and thus no longer relies on either a ‘blog’ tag, or an addCollection statement in the eleventy.js file? And how would I get those blog posts to appear on my includes/collection template?
I’ve added /blog to my normal navigation, but pointing to Custom Application Development Software for Business - Salesforce.com shows no collection, and there’s nothing on the individual blog page at Custom Application Development Software for Business - Salesforce.com.
Apologies for all the questions. Just couldn’t find the answers. Yet I notice in the various tutorials that their owners seem to have got it working fine and don’t mention those issues. And there’s no platform page for Eleventy. So I’ve got pretty stuck.
Thanks in advance if anyone has any advice on any of those issues!
My config.yml file:
backend:
name: git-gateway
branch: prod
media_folder: "src/images/uploads" # Placed in src?
public_folder: "/images/uploads"
collections:
- name: "blog" # Used in routes, e.g., /admin/collections/blog
label: "Blog" # Used in the UI
folder: "/blog" # 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: "Layout", name: "layout", widget: "hidden", default: "post", required: false}
- {label: "Title", name: "title", widget: "string"}
- {label: "Subtitle", name: "subtitle", widget: "string"}
- {label: "Extract", name: "extract", widget: "string", required: false}
- {label: "Summary", name: "summary", widget: "string", required: false}
- {label: "Publish Date", name: "date", widget: "datetime"}
- {label: "Featured Image", name: "thumbnail", widget: "image", required: false}
- {label: "Rating (scale of 1-5)", name: "rating", widget: "number", required: false}
- {label: "Body", name: "body", widget: "markdown"}