zerostaticthemes / hugo-winston-theme

A minimal and bold blog theme for Hugo
https://hugo-winston.netlify.app/
MIT License
268 stars 110 forks source link

Can posts be added/edited with Netlify CMS? #14

Closed vitumen closed 1 year ago

vitumen commented 2 years ago

I had tried deploying it on Netlify and also on Github Pages. With the latter you only can edit/add posts by editing the .mds, but i wanted to know if this can be done through Netlify CMS tools.

JugglerX commented 1 year ago

Adding Netlify CMS would take a lot of effort and there is not plan to support it. Netlify CMS does not have great support anymore. I would recommend trying Forestry CMS or Cloudcannon CMS for a git based CMS.

SyedAhkam commented 1 year ago

It's actually not that hard. I got it to work using this config.

backend:
  name: git-gateway
  branch: master

site_url: <your-site-url>
logo_url: <your-site-url>/favicon.png
publish_mode: editorial_workflow

media_folder: "static/images/uploads"
public_folder: "/images/uploads"

collections:
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Blog" # Used in the UI
    folder: "content/posts" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    slug: "{{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: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Description", name: "description", widget: "text"}
      - {label: "Featured Image", name: "image", widget: "image", required: false}
      - {label: "Body", name: "body", widget: "markdown"}
  - name: "page"
    label: "Page"
    folder: "content/pages"
    create: true
    slug: "{{slug}}"
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "URL", name: "url", widget: "string"}
      - {label: "Image", name: "image", widget: "image", required: false}
      - {label: "Body", name: "body", widget: "markdown"}

This allows you to perform CRUD operations on both blog posts and static pages like about section.