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

Cannot set default frontmatter format #9363

Closed
ktprograms opened this issue Jan 7, 2022 · 5 comments
Closed

Cannot set default frontmatter format #9363

ktprograms opened this issue Jan 7, 2022 · 5 comments
Labels

Comments

@ktprograms
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.91.0+extended darwin/arm64 BuildDate=unknown

Does this issue reproduce with the latest release?

Yes

When creating a new site with hugo new site blog -f toml, the configuration file is correctly in a toml format, but when creating new posts with hugo new test.md, the frontmatter is in a yaml format.

As far as I can see, there isn't any configuration option to set the default frontmatter format, so this issue can be solved one of two ways:

  • Add a option in the configuration file for which frontmatter format to use.
  • In the documentation for options for hugo new site, don't mention that the -f option can control the config & frontmatter format
bep added a commit that referenced this issue Jan 7, 2022
@bep bep closed this as completed in 74f0777 Jan 7, 2022
@ktprograms
Copy link
Author

@bep Is there any way to create a new post with toml frontmatter?

@bep
Copy link
Member

bep commented Jan 7, 2022

@ktprograms the "hugo new" post now uses whatever format lives in the archetype file -- so what you want to do is to create a custom template(s) in the /archetype folder. We used to respect the mentioned setting, but it became really complicated to maintain after we got archetype folder and templating support ...

@ktprograms
Copy link
Author

@bep I see. Thanks.

So I would either modify the syntax in the archetypes/default.md file, or add a archetypes/toml-frontmatter.md file and use it with hugo new -k toml-frontmatter name-of-post.md, right?

@bep
Copy link
Member

bep commented Jan 7, 2022

Yea, that's right -- I would probably just edit the default...

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants