From c8c4ac861a9fc5677aef9d8c82e19cf1ebf8d7ec Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:37:20 +1000 Subject: [PATCH] Add source to variables when rendering to support reveal.js and slide decks or re-using the content source --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3df8d58..8f77ca1 100644 --- a/main.go +++ b/main.go @@ -467,13 +467,14 @@ func buildMarkdown(path string, w io.Writer, vars Vars) error { return err } - content, err := render(body, v) + source, err := render(body, v) if err != nil { return err } + v["source"] = source buf := &bytes.Buffer{} - if err := Parser.Convert([]byte(content), buf); err != nil { + if err := Parser.Convert([]byte(source), buf); err != nil { return err } v["content"] = buf.String()