hugolib: Do not tolower result from Page.GetParam

We still do lowering of the param strings in some internal use of this, but the exported `GetParam` method is changed to a more sensible default.

This was used for the `disqus_title` etc. in the internal Disqus template, which was obviously not right.

If you really want to lowercase your params, do it with `.GetParam "myparam" | lower` or similar.

Fixes #4187
This commit is contained in:
Bjørn Erik Pedersen
2017-12-29 08:58:38 +01:00
parent e141294619
commit 1c114d539b
5 changed files with 23 additions and 19 deletions

View File

@@ -714,7 +714,7 @@ func (p *Page) renderContent(content []byte) []byte {
func (p *Page) getRenderingConfig() *helpers.BlackFriday {
p.renderingConfigInit.Do(func() {
bfParam := p.GetParam("blackfriday")
bfParam := p.getParamToLower("blackfriday")
if bfParam == nil {
p.renderingConfig = p.s.ContentSpec.BlackFriday
return
@@ -1306,6 +1306,10 @@ func (p *Page) update(f interface{}) error {
}
func (p *Page) GetParam(key string) interface{} {
return p.getParam(key, false)
}
func (p *Page) getParamToLower(key string) interface{} {
return p.getParam(key, true)
}