Beispiel #1
0
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
}
Beispiel #2
0
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())
}