decaporg / decaporg/decap-cms

Ignore files from collection (hugo _index.md)

Open
#2,727 21 comments 26 reactions 0 assignees View on GitHub
kind: feature pinned ssg: hugo status: needs planning
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

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](https://www.netlifycms.org/docs/configuration-options/#collections) to let us give an array with some files to be ignored

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.