mirror of
https://github.com/gohugoio/hugo.git
synced 2024-07-05 08:42:12 +00:00
Add config options: disable footnote anchor prefix and header ID suffix
New config options: * DisableFootnoteAnchorPrefix - bool - default: false * DisableHeaderIDSuffix - bool - default: false
This commit is contained in:
parent
dca6eabaca
commit
b7716948bc
|
@ -123,6 +123,8 @@ func InitializeConfig() {
|
||||||
viper.SetDefault("BuildDrafts", false)
|
viper.SetDefault("BuildDrafts", false)
|
||||||
viper.SetDefault("BuildFuture", false)
|
viper.SetDefault("BuildFuture", false)
|
||||||
viper.SetDefault("UglyUrls", false)
|
viper.SetDefault("UglyUrls", false)
|
||||||
|
viper.SetDefault("DisableFootnoteAnchorPrefix", false)
|
||||||
|
viper.SetDefault("DisableHeaderIDSuffix", false)
|
||||||
viper.SetDefault("Verbose", false)
|
viper.SetDefault("Verbose", false)
|
||||||
viper.SetDefault("CanonifyUrls", false)
|
viper.SetDefault("CanonifyUrls", false)
|
||||||
viper.SetDefault("Indexes", map[string]string{"tag": "tags", "category": "categories"})
|
viper.SetDefault("Indexes", map[string]string{"tag": "tags", "category": "categories"})
|
||||||
|
|
|
@ -85,8 +85,11 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
|
||||||
FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"),
|
FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(ctx.DocumentId) != 0 {
|
if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableFootnoteAnchorPrefix") {
|
||||||
renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix
|
renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableHeaderIDSuffix") {
|
||||||
renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId
|
renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue