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

config.toml isn't read by default #1363

Closed
drewwells opened this issue Aug 18, 2015 · 5 comments
Closed

config.toml isn't read by default #1363

drewwells opened this issue Aug 18, 2015 · 5 comments
Milestone

Comments

@drewwells
Copy link

Creating a new site and starting it hugo server -t slim --buildDrafts gives errors unable to find config.

Error:

hugo server -t slim --buildDrafts
ERROR: 2015/08/18 Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details
ERROR: 2015/08/18 No 'baseurl' set in configuration or as a flag. Features like page menus will not work without one.

Adding this to the server call fixes the issue. --config=config.toml

@drewwells
Copy link
Author

Reproduced on dac9c0d

@anthonyfok
Copy link
Member

Same problem here, though hugo at dac9c0d was working just fine several days ago.

It turns out that the Viper's way of searching config file handling was changed two days ago:

Thankfully, the author of the patch has included a note telling us how to get the old behaviour back: spf13/viper#73 (comment)

To get the pre-fix functionality back in your application, add the following call the proper viper callee > after adding all other search paths to it:

viper.AddConfigPath(".")

This fix works for me. Will commit a fix soon. :-)

@drewwells
Copy link
Author

Fixed, thanks!

On Wed, Aug 19, 2015 at 1:43 AM Anthony Fok notifications@github.com
wrote:

Closed #1363 #1363 via 4047ca5
4047ca5
.


Reply to this email directly or view it on GitHub
#1363 (comment).

@akbarsha03
Copy link

After I create the site I forgot to navigate to the newly created directory on my command prompt which caused the issue

tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
As of 2015-08-16, Viper no longer searches the CWD
for config file by default to avoid unintended surprises,
but Hugo relies on the original behaviour.

Fixed by calling

    viper.AddConfigPath(".")

at the appropriate place.

See spf13/viper#73 for more information.

Fixes gohugoio#1363
bep added a commit that referenced this issue Mar 21, 2021
9cece6640 Function sort: fix example labels (#1344)
84444120f Revert "Fix sample data for sort function (#1363)" (#1364)
05c8619f4 Fix sample data for sort function (#1363)
2beb1c0ed Fix "Configure taxonomies" title (#1361)
cd777b9fb Fix sitemap configuration link (#1360)
52251fb42 Update the 'Customize Dates' example to not error (#1357)
1a14cc08a Update quick-start.md
17bb98a94 Add note about image metadata removal
ec4f7bfff Update 404.md
cebfb7a90 explaination that `weight` key is used for sorting
83190ff12 fix typo: "advance settings" → "advanced settings"
75743968c Update quick-start.md
f1c64cd5a Improved documentation.
8af3b236c Update theme

git-subtree-dir: docs
git-subtree-split: 9cece6640095a21673a730201466ea636d2f8ded
@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 Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants