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 tpl/site #5470

Closed
regisphilibert opened this Issue Nov 25, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@regisphilibert
Copy link

regisphilibert commented Nov 25, 2018

If it's not much more complicated than #5467, it would be useful to also have site globally available.

It would save having to pass the Page Context to a template which only a needs few params on top of being able to use a few .Site variable/method. (ex: .Site.IsServer #4981 (comment))

@bep

This comment has been minimized.

Copy link
Member

bep commented Nov 25, 2018

I guess that makes sense. But we should probably stop with this one ... Note that I'm not sure about the "how complicated", because there is a dependency graph that may make this harder than trivial...

@bep bep added the Enhancement label Nov 25, 2018

@bep bep added this to the v0.53 milestone Nov 25, 2018

@regisphilibert

This comment has been minimized.

Copy link

regisphilibert commented Nov 25, 2018

Got it. It's all about the complexity/critical ratio.
It would makes sense that site variables are accessible globally, but again not a critical.

@bep bep self-assigned this Nov 26, 2018

@bep bep modified the milestones: v0.53, v0.52 Nov 26, 2018

@bep bep removed their assignment Nov 26, 2018

bep added a commit to bep/hugo that referenced this issue Dec 6, 2018

Add site as template namespace
This means that the current `Site` is available as a global, so you can do `site.IsServer` etc.

Fixes gohugoio#5470

This was referenced Dec 6, 2018

bep added a commit to bep/hugo that referenced this issue Dec 6, 2018

Add tpl/site and tpl/hugo
This means that the current `Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer` `hugo.Version` etc.

Fixes gohugoio#5470
Fixes gohugoio#5467
Fixes gohugoio#5503

bep added a commit to bep/hugo that referenced this issue Dec 6, 2018

Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc.

Fixes gohugoio#5470
Fixes gohugoio#5467
Fixes gohugoio#5503

bep added a commit to bep/hugo that referenced this issue Dec 6, 2018

Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc.

Fixes gohugoio#5470
Fixes gohugoio#5467
Fixes gohugoio#5503

@bep bep closed this in 831d23c Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment