From: Jacob Gillespie Date: Mon, 5 Jan 2015 18:18:34 +0000 (-0600) Subject: Group both options under Blackfriday: documentIDAnchor X-Git-Tag: v0.13~213 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4adf58cce7cfa22401dcb68897fd60142a83885d;p=brevno-suite%2Fhugo Group both options under Blackfriday: documentIDAnchor --- diff --git a/commands/hugo.go b/commands/hugo.go index 6cb153e1..e04a8a0d 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -123,8 +123,6 @@ 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"}) @@ -138,7 +136,7 @@ func InitializeConfig() { viper.SetDefault("FootnoteAnchorPrefix", "") viper.SetDefault("FootnoteReturnLinkContents", "") viper.SetDefault("NewContentEditor", "") - viper.SetDefault("Blackfriday", map[string]bool{"angledQuotes": false}) + viper.SetDefault("Blackfriday", map[string]bool{"angledQuotes": false, "documentIDAnchor": true}) if hugoCmdV.PersistentFlags().Lookup("buildDrafts").Changed { viper.Set("BuildDrafts", Draft) diff --git a/helpers/content.go b/helpers/content.go index baccc857..8770c88e 100644 --- a/helpers/content.go +++ b/helpers/content.go @@ -85,11 +85,8 @@ func GetHtmlRenderer(defaultFlags int, ctx RenderingContext) blackfriday.Rendere FootnoteReturnLinkContents: viper.GetString("FootnoteReturnLinkContents"), } - if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableFootnoteAnchorPrefix") { + if m, ok := ctx.ConfigFlags["documentIDAnchor"]; ok && m && len(ctx.DocumentId) != 0 { renderParameters.FootnoteAnchorPrefix = ctx.DocumentId + ":" + renderParameters.FootnoteAnchorPrefix - } - - if len(ctx.DocumentId) != 0 && !viper.GetBool("DisableHeaderIDSuffix") { renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId }