示例#1
0
文件: page.go 项目: vincentsys/hugo
func (p *Page) determineMarkupType() string {
	// Try markup explicitly set in the frontmatter
	p.Markup = helpers.GuessType(p.Markup)
	if p.Markup == "unknown" {
		// Fall back to file extension (might also return "unknown")
		p.Markup = helpers.GuessType(p.Source.Ext())
	}

	return p.Markup
}
示例#2
0
文件: page.go 项目: JTrembl1/hugo
func (p *Page) guessMarkupType() string {
	// First try the explicitly set markup from the frontmatter
	if p.Markup != "" {
		format := helpers.GuessType(p.Markup)
		if format != "unknown" {
			return format
		}
	}

	return helpers.GuessType(p.Source.Ext())
}