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)
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;
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