示例#1
0
文件: page.go 项目: nitoyon/hugo
func (p *Page) renderContent(content []byte) []byte {
	var fn helpers.LinkResolverFunc
	var fileFn helpers.FileResolverFunc
	if p.getRenderingConfig().SourceRelativeLinksEval {
		fn = func(ref string) (string, error) {
			return p.Node.Site.GitHub(ref, p)
		}
		fileFn = func(ref string) (string, error) {
			return p.Node.Site.GitHubFileLink(ref, p)
		}
	}
	return helpers.RenderBytesWithTOC(&helpers.RenderingContext{Content: content, PageFmt: p.guessMarkupType(),
		DocumentID: p.UniqueID(), Config: p.getRenderingConfig(), LinkResolver: fn, FileResolver: fileFn})
}
示例#2
0
文件: page.go 项目: JTrembl1/hugo
func (p *Page) renderContent(content []byte) []byte {
	return helpers.RenderBytesWithTOC(&helpers.RenderingContext{Content: content, PageFmt: p.guessMarkupType(),
		DocumentID: p.UniqueID(), Config: p.getRenderingConfig()})
}
示例#3
0
文件: page.go 项目: kuruma/hugo
func (p *Page) renderContent(content []byte) []byte {
	return helpers.RenderBytesWithTOC(content, p.guessMarkupType(), p.UniqueId())
}