From 69a3d0123be4c645d5318b5e9d0a5e68f6324b58 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Wed, 7 Dec 2022 11:29:15 -0500 Subject: Add basic string functions to default template funcmap. Set a var when page is being rendered markdown only. --- page/renderJson.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'page/renderJson.go') diff --git a/page/renderJson.go b/page/renderJson.go index 52e707d..9359b69 100644 --- a/page/renderJson.go +++ b/page/renderJson.go @@ -66,6 +66,13 @@ func RenderJson(w http.ResponseWriter, r *http.Request, } if r.URL.Query().Get("markdown") == "1" { + if p.Vars != nil { + p.Vars["RenderingMarkdownOnly"] = true + } else { + p.Vars = map[string]interface{}{ + "RenderingMarkdownOnly": true, + } + } // Tossing the error, since it would've been revealed above md, _ := p.GetMarkdown() out["Markdown"] = md -- cgit v1.2.3