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 #8979

Closed
bep opened this issue Sep 17, 2021 · 4 comments · Fixed by #10621
Closed

Make hugo.toml the new config.toml #8979

bep opened this issue Sep 17, 2021 · 4 comments · Fixed by #10621
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Sep 17, 2021

So, the naming of Hugo's default config file config.toml (and json ...) was a mistake. The reasoning:

  • It's very generic, so there are potential naming conflicts in multi-framework setups
  • It's very generic, so it cannot be used for discoverability (that is a Hugo project)

I have looked at this before and just brushed it off with a "there are too many projects out there", but I now think we should just do it:

  • So, config.toml will still be a fall back, but we first try hugo.toml.
  • We may, some time in the future, add some warnings to the config.toml case, but that is not in scope for now.
  • I also suggest, as part of this, that we make having a hugo.toml (or JSON ...) eventually be a requirement for any Hugo project (even if it's empty).
@bep bep added the Proposal label Sep 17, 2021
@bep bep added this to the v0.88.1 milestone Sep 17, 2021
@bep bep self-assigned this Sep 17, 2021
@bep bep modified the milestones: v0.88.1, v0.89 Sep 17, 2021
@bep bep added Enhancement and removed Proposal labels Sep 18, 2021
bep added a commit to bep/hugo that referenced this issue Sep 18, 2021
Note that the old, e.g. config.toml, still works fine.

See gohugoio#8979
bep added a commit to bep/hugo that referenced this issue Sep 19, 2021
Note that the old, e.g. config.toml, still works fine.

See gohugoio#8979
bep added a commit to bep/hugo that referenced this issue Sep 19, 2021
Note that the old, e.g. config.toml, still works fine.

See gohugoio#8979
@nancym
Copy link

nancym commented Sep 22, 2021

If ROOT/config.EXTENSION is replaced with ROOT/hugo.EXTENSION, I wonder if any of the following should be changed for consistency:

  • Should configDir be renamed hugoDir?
  • Should ROOT/config/_default/hugo.EXTENSION be renamed ROOT/hugo/_default/hugo.EXTENSION?
  • Should --config switch be renamed --hugo switch?

I don't have an opinion about this, but it's something to think about.

Thanks for all your great work bep and others!

@moorereason
Copy link
Contributor

@nancym, it's still the hugo config. The goal is to make the file name less ambiguous in the context of a generic filesystem. The --config option is scoped to the hugo command, so there's no real ambiguity there.

The ROOT/config/ directory name has a similar ambiguity, so that's something to consider. Even if that's changed, I'm not sure configDir needs to change, so it's scoped to the hugo config.

@bep
Copy link
Member Author

bep commented Sep 23, 2021

@moorereason is right. My primary motivation behind this is to get to a state where _every Hugo project has a hugo.* file). So, if you have a config dir, we will probably also enforce a (empty?) hugo.* file. There will be situations where people would want to name them differently (having multiple configs), so the options for configDir etc. still make sense.

@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 8, 2021
@bep bep modified the milestones: v0.91.0, v0.92.0 Dec 20, 2021
@bep bep modified the milestones: v0.92.0, v0.93.0 Jan 12, 2022
@bep bep modified the milestones: v0.93.0, v0.94.0 Mar 1, 2022
@bep bep modified the milestones: v0.94.0, v0.95.0, v0.96.0 Mar 9, 2022
@bep bep modified the milestones: v0.96.0, v0.97.0 Mar 24, 2022
@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@bep bep modified the milestones: v0.102.0, v0.103.0 Aug 28, 2022
@bep bep modified the milestones: v0.103.0, v0.104.0 Sep 15, 2022
@bep bep modified the milestones: v0.104.0, v0.105.0 Sep 23, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 26, 2022
@bep bep modified the milestones: v0.106.0, v0.107.0 Nov 18, 2022
@bep bep modified the milestones: v0.107.0, v0.108.0 Dec 3, 2022
@bep bep modified the milestones: v0.108.0, v0.109.0 Dec 14, 2022
bep added a commit to bep/hugo that referenced this issue 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 gohugoio#8979
bep added a commit to bep/hugo that referenced this issue 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 gohugoio#8979
bep added a commit that referenced this issue 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
@anthonyfok anthonyfok modified the milestones: v0.109.0, v0.110.0 Jan 23, 2023
obrienmikej added a commit to obrienmikej/mikejobrien.com that referenced this issue Feb 6, 2023
@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 Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants