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

Make hugo.toml the new config.toml #10621

Merged
merged 1 commit into from
Jan 16, 2023
Merged

Conversation

bep
Copy link
Member

@bep bep commented Jan 16, 2023

Both will of course work, but hugo.toml will win if both are set.

We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some
JSON config schema from some random other software which also names its config files config.toml.

Fixes #8979

Both will of course work, but hugo.toml will win if both are set.

We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some
JSON config schema from some random other software which also names its config files config.toml.

Fixes gohugoio#8979

`

for _, configName := range []string{"hugo.toml", "config.toml"} {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmooring do you see any problems with this test case?

Note that

  • For the main config file in the root, we will pick the first. For the config.toml inside /config, I have made it simple so you can in theory have both, but that should not be a problem...
  • I will wait a little before changing the behaviour of hugo new site

Also note that the main motivation behind me doing this now is VS Code starting to pick some other random config schema and is throwing these validation errors for me when doing config edits. I'm able to change this inside VS Code, but it's rather annoying, and I suspect this will improve when having a distinct filename,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested various combinations of having both config.xxx and hugo.xxx in all 4 directories, making sure that the files in root or theme root are not merged, and files in the config root or theme config root are merged. Looks good to me.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm updating my Hugo-related web pages, for example https://www.ii.com/hugo-data-directory/, and discovered that hugo new site is still creating config.toml rather than hugo.toml. I know @bep is waiting a little to change this, but my vote is to change it ASAP because it makes it easier for those of us who want to document this new thing. Thanks!

@bep bep merged commit f38a2fb into gohugoio:master Jan 16, 2023
jmooring added a commit to jmooring/hugo that referenced this pull request Apr 18, 2023
Follow-up to gohugoio#10621.

Remaining documentation changes will be addressed in the documentation
repository after this is merged and released.
Copy link

This pull request 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 Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make hugo.toml the new config.toml
3 participants