Skip to content

Ignore files from collection (hugo _index.md) #2727

@panakour

Description

@panakour

I have a hugo site in which I have a content called "project".
My config file:

collections:
  - name: "project" 
    editor:
      preview: false
    label: "Project"
    folder: "site/content/project"
    create: true
    fields:
      - {label: "Featured", name: "featured", widget: "boolean", default: false}
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Project Date", name: "project_date", widget: "datetime"}
      - {label: "Head Image (Recommended 1920x1080)", name: "head_image", widget: "image", required: false}
      - {label: "Thumbnail Image (Recommended 360x560)", name: "thumb_image", widget: "image", required: false}
      - {label: "Images", name: "images", widget: list, field:
        {label: "Image (Recommended 800x500)", name: "image", widget: "image"}}
      - {label: "Description", name: "body", widget: "markdown"}

The admin is working fine and I can create/edit my projects. The issue is that the admin also show the _index.md file which is used from hugo for the list page. Also this file has different front-matter (I have a file collection for this to edit from the cms).

The solution you'd like
For hugo site should automatically excludes this file from the collection.

alternatives you've considered
Maybe a better and more generic solution for all SSGs is to have a config option to let us give an array with some files to be ignored

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions