Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document restricted first character for content files without front matter #2703

Open
McShelby opened this issue Sep 17, 2024 · 2 comments
Open

Comments

@McShelby
Copy link

As a follow up of gohugoio/hugo#12855, I kindly ask to document the limitations of Markdown if no front matter is defined:

Front matter is optional, but can't begin with a character that matches the characters in front matter delimiters: -, +, {.

I am not sure, if this is only the case for page resources or pages in general. At the moment I think, a good location to add this would be https://gohugo.io/content-management/formats/#markdown

@jmooring
Copy link
Member

jmooring commented Sep 17, 2024

The content format is irrelevant. If a content file does not include front matter, the first character must not be +, -, or {.

The only situation in which it might make sense to exclude front matter is when the content file is a page resource.

This page...
https://gohugo.io/content-management/page-resources/

...needs a section titled "Resource types" where we refer to the ResourceType method and provide a tree structure example with annotations. Then include a note about front matter when ResourceType is page.

We can potentially address #2428 at the same time.

@jmooring jmooring changed the title document content limitations for Markdown Document restricted first character for content files without front matter Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jmooring @McShelby and others