.Site.IsServer gone missing

I am debugging (with kaushalmodi/debugprint) my site and .Site parameters after trying to do a development server thingy on my site and it appears, that .Site.IsServer is gone missing on both. Doing

{{ partial "debugprint" .Site }}
{{ partial "debugprint" site }}

brings lot’s of variables and values, but not IsServer. And the server is running on hugo server.

Is this a bug (Github has no open issue about it) or could it be that the site variables in a partial might be modified somehow? It’s in the footer of the site, so plenty of stuff was done before to make the site look nice.

(And yeah, latest Hugo, doh :))

There is a lot of these variables missing:

I can’t see Languages, Data, Sections. I might have a general issue or misunderstanding here.

Spamming the post here… it appears that those “variables” are not variables, but functions that are created when calling them. If I debug .Site.IsServer I receive a true, if I debug .Site, then IsServer is missing. That’s an issue with the documentation I guess, there should be a way to mark values as “being created when requested” and “always available” - or call them functions :wink:

This is the bit that renders the site vars: https://github.com/kaushalmodi/hugo-debugprint/blob/master/layouts/partials/debugprint.html#L80-L90


{{ $siteVarSymbols := (slice .Title  .Author  .Social  .LastChange  .DisqusShortname  .GoogleAnalytics  .Copyright  .RSSLink  .LanguageCode  .BuildDrafts  .Params ) }}
1 Like

Oh, it never occured to me that it might be “opinionated”. I thought it might just iterate through it all… Thanks, I will investigate.

I suspect these will show up if you do {{ site | jsonify }} – but you are right, they are methods.