Skip to content

Enhancement: Add alternative method for content type identification #467

@michaeltlombardi

Description

@michaeltlombardi

Is your feature request related to a problem? Please describe.

Currently, the only way to have Front Matter recognize a file as a particular content type is to define the type field in the file's frontmatter and have that value map to a known content type.

For some static site generators, like Hugo, the type field carries semantic meaning outside of Front Matter. This can (but doesn't always) cause conflicts or require work arounds for defining content types in Front Matter.

Describe the solution you'd like

I would like an alternative way to inform Front Matter about settings/behaviors specific to Front Matter, rather than the content/static site generator.

For example, adding the _frontMatter (or other name, this is just an example) field as a map of key-value pairs (type being one of them) and overriding other discoverable values with those would allow Front Matter to be used side-by-side with static site generators that have colliding field names.

If the _frontMatter field is an optional override, it won't require any additional changes from users who don't have to resolve the conflict.

Describe alternatives you've considered

Right now, the only alternative is to ensure my content types always match my Hugo types and try to account for the complexities of differing needs with the newly implemented #362 and conditional UI.

Additional context

If the _frontMatter field is implemented, the UI can be updated to have a foldable section in the side bar for altering settings specific to that file and Front Matter, if needed (though I think that's a separate feature request if this is implemented). This also opens the possibility of extending/overriding (a limited subset of) behaviors on a per-file basis. For example, defining an alternate preview path or metadata requirements. Again, I don't mean to bikeshed on that idea here, simply to remark that implementing this feature to resolve a field name collision opens the possibility for investigation and discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In BETAThe current task is available for testing in the BETA version.enhancementNew feature or requestv10.3.0Project: v10.3.0

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions