function nb:ngx_location_md(fheader,ffooter)
-- See https://github.com/bungle/lua-resty-template
-- location ~ \.(md|html)$ {
--- default_type text/html;
-- content_by_lua 'package.path = ngx.var.NB_ROOT .. "/lib/lua/?.lua;" .. package.path local nb = require("nb") nb:ngx_location_md()';
-- }
if not fheader then fheader = ngx.var.document_root .. "/header.html" end
local header = self:readall(fheader)
local footer = nb:readall(ffooter)
content = header .. content .. footer
+ ngx.header["Content-type"] = "text/html"
end
template.render(content,vars)