-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add .Site.IsServer to determine if the site was built in server mode #4478
Comments
But isn't this already possible by simply checking if |
Not if you run your server with something other than "localhost". I do that all the time. You could, of course, adjust that logic to also check for that hostname, but that would hardly be very portable. |
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. |
As per the following Discourse discussion:
https://discourse.gohugo.io/t/disable-portions-of-content-while-developing/10860
It would be helpful to put a condition into a template that can determine whether the page is being built/server by
hugo server
(and not necessarily with the-D
flag, for which there is already a variable).This would be helpful for the case where you want to test the site in its final form (no drafts) but want to switch off, e.g. analytics or ads.
The text was updated successfully, but these errors were encountered: