Skip to content

Commit

Permalink
replace hige by lustache
Browse files Browse the repository at this point in the history
  • Loading branch information
Eynix committed Jun 7, 2018
1 parent 09432a3 commit 23eb2fc
Show file tree
Hide file tree
Showing 11 changed files with 1,528 additions and 157 deletions.
3 changes: 2 additions & 1 deletion debian/install
Expand Up @@ -2,6 +2,7 @@ init.lua /usr/share/ssowat
access.lua /usr/share/ssowat
helpers.lua /usr/share/ssowat
config.lua /usr/share/ssowat
hige.lua /usr/share/ssowat
lustache.lua /usr/share/ssowat
lustache /usr/share/ssowat
portal /usr/share/ssowat
conf.json.example /etc/ssowat
7 changes: 7 additions & 0 deletions debian/install.bak
@@ -0,0 +1,7 @@
init.lua /usr/share/ssowat
access.lua /usr/share/ssowat
helpers.lua /usr/share/ssowat
config.lua /usr/share/ssowat
hige.lua /usr/share/ssowat
portal /usr/share/ssowat
conf.json.example /etc/ssowat
8 changes: 4 additions & 4 deletions helpers.lua
Expand Up @@ -469,12 +469,12 @@ function serve(uri)
-- Render as mustache
if ext == "html" then
local data = get_data_for(file)
local rendered = hige.render(read_file(script_path.."portal/header.ms"), data)
rendered = rendered..hige.render(content, data)
content = rendered..hige.render(read_file(script_path.."portal/footer.ms"), data)
local rendered = lustache:render(read_file(script_path.."portal/header.ms"), data)
rendered = rendered..lustache:render(content, data)
content = rendered..lustache:render(read_file(script_path.."portal/footer.ms"), data)
elseif ext == "ms" then
local data = get_data_for(file)
content = hige.render(content, data)
content = lustache:render(content, data)
elseif ext == "json" then
local data = get_data_for(file)
content = json.encode(data)
Expand Down

0 comments on commit 23eb2fc

Please sign in to comment.