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

.Site.IsServer set as true for hugo v0.112.1 for the main command #11006

Closed
henvic opened this issue May 23, 2023 · 3 comments · Fixed by #11011
Closed

.Site.IsServer set as true for hugo v0.112.1 for the main command #11006

henvic opened this issue May 23, 2023 · 3 comments · Fixed by #11011
Assignees
Milestone

Comments

@henvic
Copy link

henvic commented May 23, 2023

Hello, it seems that .Site.IsServer is returning true for generating pages using the main command.

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

$ hugo version
hugo v0.112.1-7c90c19d282cad63fe15220fcfb7936767b70623 darwin/amd64 BuildDate=2023-05-23T17:26:16Z

Does this issue reproduce with the latest release?

Yes.

@jmooring
Copy link
Member

jmooring commented May 23, 2023

Confirmed.

You can probably use hugo.IsProduction or hugo.Environment instead. Both return the expected results with v0.112.1.

@jmooring
Copy link
Member

jmooring commented May 24, 2023

This seems to be related:
https://discourse.gohugo.io/t/44506/3

Minimal example:

git clone --single-branch -b hugo-forum-topic-44506 https://github.com/jmooring/hugo-testing hugo-forum-topic-44506
cd hugo-forum-topic-44506
hugo

Error: failed to load modules: module "foo" not found

Then run:

hugo -e production

No problems.


This could expose sensitive/internal content.

config/
├── _default/
│   └── config.toml
└── development/
    └── module.toml  <-- BUG: this is read when running `hugo`

config/development/module.toml

[[mounts]]
source = 'content'
target = 'content'

[[mounts]]
source = 'hidden'
target = 'content'

@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 Jun 15, 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.

3 participants