Collections

All sections and taxonomies.

Collections are automatically added based on Hugolify modules added (Sections) or (Taxonomies)

Enable or disable collections

/config/_default/params.yaml

admin:
  collections:
    indexes:
      enable: true
    pages:
      enable: true
    # e.g. set to false to disable posts even if you load hugolify-theme-posts
    posts:
      enable: false
    # …

Enable or disable file creation

/config/_default/params.yaml

admin:
  collections:
    pages:
      create: false

Override fields avalaible for a collection

/config/_default/params.yaml

admin:
  collections:
    pages:
      fields:
        - is_draft
        - title_page
        - description
        - featured_image
        - body

Add filter

/config/_default/params.yaml

admin:
  collections:
    pages:
      filter:
        - field: isPage
          value: true

Add path

/config/_default/params.yaml

admin:
  collections:
    pages:
      path: "{{slug}}"

Add slug

/config/_default/params.yaml

admin:
  collections:
    pages:
      slug: "{{id}}"

Add sortable

/config/_default/params.yaml

admin:
  collections:
    pages:
      sortable: "['title']"

Add summary

/config/_default/params.yaml

admin:
  collections:
    pages:
      summary: "{{title}}"

Add view filters

/config/_default/params.yaml

admin:
  collections:
    pages:
      view_filters:
        - label: 'Posts published in 2020'
          field: date
          pattern: '2020'

Add view groups

/config/_default/params.yaml

admin:
  collections:
    pages:
      view_groups:
        - label: 'Draft'
          field: draft

Create a collection

Use params to create a collection

/config/_default/params.yaml

admin:
  collections:
    new_collection:
      enable: true
      fields:
        - draft
        - title_page
        - description
        - featured_image
        - body

Or add a yml collection file

layouts/
└── partials/
    └── admin/
        └── collections/
            └── types/
See examples in repository