From: Nicolas Boisselier Date: Thu, 10 May 2018 03:04:48 +0000 (+0100) Subject: lib/lua/nb.lua X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=d0cfff2e0e216f69ae2c74bbed2bb27d6bcd323c;p=nb.git lib/lua/nb.lua --- diff --git a/lib/lua/nb.lua b/lib/lua/nb.lua index dc515c6d..a046e23d 100644 --- a/lib/lua/nb.lua +++ b/lib/lua/nb.lua @@ -24,7 +24,6 @@ end 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 @@ -92,6 +91,7 @@ function nb:ngx_location_md(fheader,ffooter) 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)