]> Nishi Git Mirror - aya.git/commitdiff
Add source to variables when rendering to support reveal.js and slide decks or re...
authorJames Mills <1290234+prologic@users.noreply.github.com>
Wed, 29 Mar 2023 13:37:20 +0000 (23:37 +1000)
committerJames Mills <1290234+prologic@users.noreply.github.com>
Wed, 29 Mar 2023 13:37:20 +0000 (23:37 +1000)
main.go

diff --git a/main.go b/main.go
index 3df8d5838450d6b1dddf9dba12dfe5a0a2564d6e..8f77ca1676708f112794f7ea9fd218f7bcfd7ab1 100644 (file)
--- 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()