From c35758b915643387e266705c62663a16c9dc8a78 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 9 May 2018 03:20:20 +0100 Subject: [PATCH] lib/lua/nb.lua --- lib/lua/nb.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/lua/nb.lua b/lib/lua/nb.lua index 9cc21070..67cc0e52 100644 --- a/lib/lua/nb.lua +++ b/lib/lua/nb.lua @@ -5,7 +5,7 @@ local nb = { dev = 1, } -if ngx.var.PRODUCTION then nb.dev = 0 end +if ngx.var.PRODUCTION == 'yes' then nb.dev = 0 end function nb:readall(file) -- local f = io.open(file) or error("Could not open file: " .. file) local f = io.open(file) @@ -30,6 +30,7 @@ function nb:ngx_location_md(fheader,ffooter) if not ffooter then ffooter = ngx.var.document_root .. "/footer.html" end local template = require "resty.template" + -- template.markdown = require "resty.hoedown" if self.dev then template.caching(false) end local file = ngx.var.document_root .. ngx.var.uri; @@ -66,6 +67,7 @@ function nb:ngx_location_md(fheader,ffooter) local header = nb:readall(fheader) if header then template.render(header,vars) end + -- content = '{(header.html)}{*markdown[[' .. content .. ']]*}{footer.html)}' content = template.output(template.compile(content)(vars)) if string.match(file,'%.md$') then -- Markdown -- 2.47.3