GithubHelp home page GithubHelp logo

Jekyll layout template about decap-cms HOT 3 CLOSED

decaporg avatar decaporg commented on May 10, 2024
Jekyll layout template

from decap-cms.

Comments (3)

biilmann avatar biilmann commented on May 10, 2024 2

There's two ways to do it.

One is Jekyll specific and consists of setting a global layout for the post collection, you can see an example of that here:

https://github.com/netlify/netlify-home/blob/master/_config.yml#L33

The other option works for any hidden field, and it's based on adding a hidden widget with a default value to the fields:

collections: # A list of collections the CMS should be able to edit
  - name: "post" # Used in routes, ie.: /admin/collections/:slug/edit
    label: "Post" # Used in the UI, ie.: "New Post"
    folder: "_posts" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    fields: # The fields each document in this collection have
      - {label: "Title", name: "title", widget: "string", tagname: "h1"}
      - {label: "Body", name: "body", widget: "markdown"}
      - {label: "Layout", name: "layout", widget: "hidden", default: "post"}

from decap-cms.

nifl avatar nifl commented on May 10, 2024

Thanks. That's what I needed.

from decap-cms.

daaain avatar daaain commented on May 10, 2024

@biilmann I can't get this default to work, is it still supported?

from decap-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.