mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user