commit c9fc0e786f1f957b16479fba3e8c039d7f5d03f3
parent dd732e84f43570d87dba49a1e42061f8bd4f6afa
Author: Marc-Antoine Ruel <maruel@chromium.org>
Date: Thu, 2 Jul 2015 09:32:57 -0400
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.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git 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
}