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

Bug Fix: Empty .Site.Params.contentDir #312

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

jasikpark
Copy link
Contributor

When .Site.Params.contentDir is left as the default: "content", calling .Site.Params.contentDir returns nothing, or maybe an empty string. To fix this, we set a default value for .Site.Params.contentDir to "content" and the url is built correctly.

When .Site.Params.contentDir is left as the default: "content", calling .Site.Params.contentDir returns nothing, or maybe an empty string. To fix this, we set a default value for .Site.Params.contentDir to "content" and the url is built correctly.
@jasikpark
Copy link
Contributor Author

.Site.Params is a container holding the values from the params section of your site configuration.
from https://gohugo.io/variables/site/#the-siteparams-variable

.Site.Params simply returns the state of the site configuration file params rather than the actual full configuration for some reason?

@alex-shpak
Copy link
Owner

Hi! Thank you for the PR, I wil lchek around. It was not the case with contentDir before, so maybe something changed in hugo.

On which OS you run hugo?

@jasikpark
Copy link
Contributor Author

macOS 11.2.1
Hugo Static Site Generator v0.80.0/extended darwin/amd64 BuildDate: unknown

@alex-shpak
Copy link
Owner

I will merge this. Good catch 👍

@alex-shpak alex-shpak merged commit 9791db1 into alex-shpak:master Feb 22, 2021
@alex-shpak
Copy link
Owner

Perhaps worth testing with --contentDir flag 🤔

@jasikpark jasikpark deleted the patch-1 branch February 22, 2021 18:52
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

Successfully merging this pull request may close these issues.

2 participants