From c9fc0e786f1f957b16479fba3e8c039d7f5d03f3 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Ruel Date: Thu, 2 Jul 2015 09:32:57 -0400 Subject: [PATCH] Add Page.RawContent() to access raw Markdown as a string. In particular, RawContent() excludes the metadata header. This is necessary in the use case of embedding remarkjs.com slides, as it needs the unprocessed Markdown content to generate the slides. --- hugolib/page.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hugolib/page.go b/hugolib/page.go index 385bf8736..d8d8c00e6 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -726,6 +726,10 @@ func (p *Page) parse(reader io.Reader) error { return nil } +func (p *Page) RawContent() string { + return string(p.rawContent) +} + func (p *Page) SetSourceContent(content []byte) { p.Source.Content = content }