shithub: hugo

Download patch

ref: c9fc0e786f1f957b16479fba3e8c039d7f5d03f3
parent: dd732e84f43570d87dba49a1e42061f8bd4f6afa
author: Marc-Antoine Ruel <[email protected]>
date: Thu Jul 2 05:32:57 EDT 2015

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.

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -726,6 +726,10 @@
 	return nil
 }
 
+func (p *Page) RawContent() string {
+	return string(p.rawContent)
+}
+
 func (p *Page) SetSourceContent(content []byte) {
 	p.Source.Content = content
 }