Add config options: disable footnote anchor prefix and header ID suffix New config options: - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit b7716948bcdbf1703149c315f13fde63b067af7b
DIR parent dca6eabacad428c4c78bc83a0d82126285ba1290
HTML Author: Jacob Gillespie <jacobwgillespie@gmail.com>
Date: Sun, 4 Jan 2015 11:27:09 -0600
Add config options: disable footnote anchor prefix and header ID suffix
New config options:
* DisableFootnoteAnchorPrefix - bool - default: false
* DisableHeaderIDSuffix - bool - default: false
Diffstat:
M commands/hugo.go | 2 ++
M helpers/content.go | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
---
DIR diff --git a/commands/hugo.go b/commands/hugo.go
@@ -123,6 +123,8 @@ func InitializeConfig() {
viper.SetDefault("BuildDrafts", false)
viper.SetDefault("BuildFuture", false)
viper.SetDefault("UglyUrls", false)
+ viper.SetDefault("DisableFootnoteAnchorPrefix", false)
+ viper.SetDefault("DisableHeaderIDSuffix", false)
viper.SetDefault("Verbose", false)
viper.SetDefault("CanonifyUrls", false)
viper.SetDefault("Indexes", map[string]string{"tag": "tags", "category": "categories"})
DIR diff --git a/helpers/content.go b/helpers/content.go
@@ -85,8 +85,11 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere
FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"),
}
- if len(ctx.DocumentId) != 0 {
+ if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableFootnoteAnchorPrefix") {
renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix
+ }
+
+ if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableHeaderIDSuffix") {
renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId
}