本文整理汇总了Golang中github.com/spf13/hugo/helpers.NewBlackfriday函数的典型用法代码示例。如果您正苦于以下问题:Golang NewBlackfriday函数的具体用法?Golang NewBlackfriday怎么用?Golang NewBlackfriday使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewBlackfriday函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: getRenderingConfig
func (p *Page) getRenderingConfig() *helpers.Blackfriday {
p.renderingConfigInit.Do(func() {
pageParam := p.GetParam("blackfriday")
siteParam := viper.GetStringMap("blackfriday")
combinedParam := siteParam
if pageParam != nil {
combinedParam = make(map[string]interface{})
for k, v := range siteParam {
combinedParam[k] = v
}
pageConfig := cast.ToStringMap(pageParam)
for key, value := range pageConfig {
combinedParam[key] = value
}
}
p.renderingConfig = helpers.NewBlackfriday()
if err := mapstructure.Decode(combinedParam, p.renderingConfig); err != nil {
jww.FATAL.Printf("Failed to get rendering config for %s:\n%s", p.BaseFileName(), err.Error())
}
})
return p.renderingConfig
}
开发者ID:JTrembl1,项目名称:hugo,代码行数:29,代码来源:page.go
示例2: loadDefaultSettings
func loadDefaultSettings() {
viper.SetDefault("cleanDestinationDir", false)
viper.SetDefault("watch", false)
viper.SetDefault("metaDataFormat", "toml")
viper.SetDefault("disable404", false)
viper.SetDefault("disableRSS", false)
viper.SetDefault("disableSitemap", false)
viper.SetDefault("disableRobotsTXT", false)
viper.SetDefault("contentDir", "content")
viper.SetDefault("layoutDir", "layouts")
viper.SetDefault("staticDir", "static")
viper.SetDefault("archetypeDir", "archetypes")
viper.SetDefault("publishDir", "public")
viper.SetDefault("dataDir", "data")
viper.SetDefault("i18nDir", "i18n")
viper.SetDefault("themesDir", "themes")
viper.SetDefault("defaultLayout", "post")
viper.SetDefault("buildDrafts", false)
viper.SetDefault("buildFuture", false)
viper.SetDefault("buildExpired", false)
viper.SetDefault("uglyURLs", false)
viper.SetDefault("verbose", false)
viper.SetDefault("ignoreCache", false)
viper.SetDefault("canonifyURLs", false)
viper.SetDefault("relativeURLs", false)
viper.SetDefault("removePathAccents", false)
viper.SetDefault("taxonomies", map[string]string{"tag": "tags", "category": "categories"})
viper.SetDefault("permalinks", make(PermalinkOverrides, 0))
viper.SetDefault("sitemap", Sitemap{Priority: -1, Filename: "sitemap.xml"})
viper.SetDefault("defaultExtension", "html")
viper.SetDefault("pygmentsStyle", "monokai")
viper.SetDefault("pygmentsUseClasses", false)
viper.SetDefault("pygmentsCodeFences", false)
viper.SetDefault("pygmentsOptions", "")
viper.SetDefault("disableLiveReload", false)
viper.SetDefault("pluralizeListTitles", true)
viper.SetDefault("preserveTaxonomyNames", false)
viper.SetDefault("forceSyncStatic", false)
viper.SetDefault("footnoteAnchorPrefix", "")
viper.SetDefault("footnoteReturnLinkContents", "")
viper.SetDefault("newContentEditor", "")
viper.SetDefault("paginate", 10)
viper.SetDefault("paginatePath", "page")
viper.SetDefault("blackfriday", helpers.NewBlackfriday(viper.GetViper()))
viper.SetDefault("rSSUri", "index.xml")
viper.SetDefault("sectionPagesMenu", "")
viper.SetDefault("disablePathToLower", false)
viper.SetDefault("hasCJKLanguage", false)
viper.SetDefault("enableEmoji", false)
viper.SetDefault("pygmentsCodeFencesGuessSyntax", false)
viper.SetDefault("useModTimeAsFallback", false)
viper.SetDefault("currentContentLanguage", helpers.NewDefaultLanguage())
viper.SetDefault("defaultContentLanguage", "en")
viper.SetDefault("defaultContentLanguageInSubdir", false)
viper.SetDefault("enableMissingTranslationPlaceholders", false)
viper.SetDefault("enableGitInfo", false)
}
开发者ID:digitalcraftsman,项目名称:hugo,代码行数:57,代码来源:config.go
示例3: getRenderingConfig
func (p *Page) getRenderingConfig() *helpers.Blackfriday {
p.renderingConfigInit.Do(func() {
pageParam := cast.ToStringMap(p.GetParam("blackfriday"))
p.renderingConfig = helpers.NewBlackfriday()
if err := mapstructure.Decode(pageParam, p.renderingConfig); err != nil {
jww.FATAL.Printf("Failed to get rendering config for %s:\n%s", p.BaseFileName(), err.Error())
}
})
return p.renderingConfig
}
开发者ID:vincentsys,项目名称:hugo,代码行数:13,代码来源:page.go
示例4: loadDefaultSettings
func loadDefaultSettings() {
viper.SetDefault("cleanDestinationDir", false)
viper.SetDefault("Watch", false)
viper.SetDefault("MetaDataFormat", "toml")
viper.SetDefault("Disable404", false)
viper.SetDefault("DisableRSS", false)
viper.SetDefault("DisableSitemap", false)
viper.SetDefault("DisableRobotsTXT", false)
viper.SetDefault("ContentDir", "content")
viper.SetDefault("LayoutDir", "layouts")
viper.SetDefault("StaticDir", "static")
viper.SetDefault("ArchetypeDir", "archetypes")
viper.SetDefault("PublishDir", "public")
viper.SetDefault("DataDir", "data")
viper.SetDefault("ThemesDir", "themes")
viper.SetDefault("DefaultLayout", "post")
viper.SetDefault("BuildDrafts", false)
viper.SetDefault("BuildFuture", false)
viper.SetDefault("BuildExpired", false)
viper.SetDefault("UglyURLs", false)
viper.SetDefault("Verbose", false)
viper.SetDefault("IgnoreCache", false)
viper.SetDefault("CanonifyURLs", false)
viper.SetDefault("RelativeURLs", false)
viper.SetDefault("RemovePathAccents", false)
viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"})
viper.SetDefault("Permalinks", make(hugolib.PermalinkOverrides, 0))
viper.SetDefault("Sitemap", hugolib.Sitemap{Priority: -1, Filename: "sitemap.xml"})
viper.SetDefault("DefaultExtension", "html")
viper.SetDefault("PygmentsStyle", "monokai")
viper.SetDefault("PygmentsUseClasses", false)
viper.SetDefault("PygmentsCodeFences", false)
viper.SetDefault("PygmentsOptions", "")
viper.SetDefault("DisableLiveReload", false)
viper.SetDefault("PluralizeListTitles", true)
viper.SetDefault("PreserveTaxonomyNames", false)
viper.SetDefault("ForceSyncStatic", false)
viper.SetDefault("FootnoteAnchorPrefix", "")
viper.SetDefault("FootnoteReturnLinkContents", "")
viper.SetDefault("NewContentEditor", "")
viper.SetDefault("Paginate", 10)
viper.SetDefault("PaginatePath", "page")
viper.SetDefault("Blackfriday", helpers.NewBlackfriday())
viper.SetDefault("RSSUri", "index.xml")
viper.SetDefault("SectionPagesMenu", "")
viper.SetDefault("DisablePathToLower", false)
viper.SetDefault("HasCJKLanguage", false)
viper.SetDefault("EnableEmoji", false)
viper.SetDefault("PygmentsCodeFencesGuessSyntax", false)
viper.SetDefault("UseModTimeAsFallback", false)
}
开发者ID:vincentsys,项目名称:hugo,代码行数:51,代码来源:hugo.go
示例5: getRenderingConfig
func (p *Page) getRenderingConfig() *helpers.Blackfriday {
p.renderingConfigInit.Do(func() {
pageParam := cast.ToStringMap(p.GetParam("blackfriday"))
if p.Language() == nil {
panic(fmt.Sprintf("nil language for %s with source lang %s", p.BaseFileName(), p.lang))
}
p.renderingConfig = helpers.NewBlackfriday(p.Language())
if err := mapstructure.Decode(pageParam, p.renderingConfig); err != nil {
jww.FATAL.Printf("Failed to get rendering config for %s:\n%s", p.BaseFileName(), err.Error())
}
})
return p.renderingConfig
}
开发者ID:digitalcraftsman,项目名称:hugo,代码行数:17,代码来源:page.go
示例6: LoadDefaultSettings
func LoadDefaultSettings() {
viper.SetDefault("Watch", false)
viper.SetDefault("MetaDataFormat", "toml")
viper.SetDefault("DisableRSS", false)
viper.SetDefault("DisableSitemap", false)
viper.SetDefault("ContentDir", "content")
viper.SetDefault("LayoutDir", "layouts")
viper.SetDefault("StaticDir", "static")
viper.SetDefault("ArchetypeDir", "archetypes")
viper.SetDefault("PublishDir", "public")
viper.SetDefault("DataDir", "data")
viper.SetDefault("DefaultLayout", "post")
viper.SetDefault("BuildDrafts", false)
viper.SetDefault("BuildFuture", false)
viper.SetDefault("UglyURLs", false)
viper.SetDefault("Verbose", false)
viper.SetDefault("IgnoreCache", false)
viper.SetDefault("CanonifyURLs", false)
viper.SetDefault("RelativeURLs", false)
viper.SetDefault("RemovePathAccents", false)
viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"})
viper.SetDefault("Permalinks", make(hugolib.PermalinkOverrides, 0))
viper.SetDefault("Sitemap", hugolib.Sitemap{Priority: -1})
viper.SetDefault("PygmentsStyle", "monokai")
viper.SetDefault("DefaultExtension", "html")
viper.SetDefault("PygmentsUseClasses", false)
viper.SetDefault("PygmentsCodeFences", false)
viper.SetDefault("DisableLiveReload", false)
viper.SetDefault("PluralizeListTitles", true)
viper.SetDefault("PreserveTaxonomyNames", false)
viper.SetDefault("FootnoteAnchorPrefix", "")
viper.SetDefault("FootnoteReturnLinkContents", "")
viper.SetDefault("NewContentEditor", "")
viper.SetDefault("Paginate", 10)
viper.SetDefault("PaginatePath", "page")
viper.SetDefault("Blackfriday", helpers.NewBlackfriday())
viper.SetDefault("RSSUri", "index.xml")
viper.SetDefault("SectionPagesMenu", "")
}
开发者ID:nicrioux,项目名称:hugo,代码行数:39,代码来源:hugo.go
示例7: InitializeConfig
// InitializeConfig initializes a config file with sensible default configuration flags.
func InitializeConfig() {
viper.SetConfigFile(CfgFile)
viper.AddConfigPath(Source)
err := viper.ReadInConfig()
if err != nil {
jww.ERROR.Println("Unable to locate Config file. Perhaps you need to create a new site. Run `hugo help new` for details")
}
viper.RegisterAlias("indexes", "taxonomies")
viper.SetDefault("Watch", false)
viper.SetDefault("MetaDataFormat", "toml")
viper.SetDefault("DisableRSS", false)
viper.SetDefault("DisableSitemap", false)
viper.SetDefault("ContentDir", "content")
viper.SetDefault("LayoutDir", "layouts")
viper.SetDefault("StaticDir", "static")
viper.SetDefault("ArchetypeDir", "archetypes")
viper.SetDefault("PublishDir", "public")
viper.SetDefault("DataDir", "data")
viper.SetDefault("DefaultLayout", "post")
viper.SetDefault("BuildDrafts", false)
viper.SetDefault("BuildFuture", false)
viper.SetDefault("UglyURLs", false)
viper.SetDefault("Verbose", false)
viper.SetDefault("IgnoreCache", false)
viper.SetDefault("CanonifyURLs", false)
viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "categories"})
viper.SetDefault("Permalinks", make(hugolib.PermalinkOverrides, 0))
viper.SetDefault("Sitemap", hugolib.Sitemap{Priority: -1})
viper.SetDefault("PygmentsStyle", "monokai")
viper.SetDefault("DefaultExtension", "html")
viper.SetDefault("PygmentsUseClasses", false)
viper.SetDefault("DisableLiveReload", false)
viper.SetDefault("PluralizeListTitles", true)
viper.SetDefault("FootnoteAnchorPrefix", "")
viper.SetDefault("FootnoteReturnLinkContents", "")
viper.SetDefault("NewContentEditor", "")
viper.SetDefault("Paginate", 10)
viper.SetDefault("PaginatePath", "page")
viper.SetDefault("Blackfriday", helpers.NewBlackfriday())
if hugoCmdV.PersistentFlags().Lookup("buildDrafts").Changed {
viper.Set("BuildDrafts", Draft)
}
if hugoCmdV.PersistentFlags().Lookup("buildFuture").Changed {
viper.Set("BuildFuture", Future)
}
if hugoCmdV.PersistentFlags().Lookup("uglyUrls").Changed {
viper.Set("UglyURLs", UglyURLs)
}
if hugoCmdV.PersistentFlags().Lookup("disableRSS").Changed {
viper.Set("DisableRSS", DisableRSS)
}
if hugoCmdV.PersistentFlags().Lookup("disableSitemap").Changed {
viper.Set("DisableSitemap", DisableSitemap)
}
if hugoCmdV.PersistentFlags().Lookup("verbose").Changed {
viper.Set("Verbose", Verbose)
}
if hugoCmdV.PersistentFlags().Lookup("pluralizeListTitles").Changed {
viper.Set("PluralizeListTitles", PluralizeListTitles)
}
if hugoCmdV.PersistentFlags().Lookup("editor").Changed {
viper.Set("NewContentEditor", Editor)
}
if hugoCmdV.PersistentFlags().Lookup("logFile").Changed {
viper.Set("LogFile", LogFile)
}
if BaseURL != "" {
if !strings.HasSuffix(BaseURL, "/") {
BaseURL = BaseURL + "/"
}
viper.Set("BaseURL", BaseURL)
}
if viper.GetString("BaseURL") == "" {
jww.ERROR.Println("No 'baseurl' set in configuration or as a flag. Features like page menus will not work without one.")
}
if Theme != "" {
viper.Set("theme", Theme)
}
if Destination != "" {
viper.Set("PublishDir", Destination)
}
if Source != "" {
viper.Set("WorkingDir", Source)
} else {
//.........这里部分代码省略.........
开发者ID:sun-friderick,项目名称:hugo,代码行数:101,代码来源:hugo.go
注:本文中的github.com/spf13/hugo/helpers.NewBlackfriday函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论