Static site generator made with Lua script.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
411 B

-- @module template
local template = {}
--
local lume = require 'satelito.lib.lume.lume'
-- Find the path to a template file from his name
function template.find(templates, templatename)
local _template = lume.match(
templates,
function(tpl)
-- Try to find a match
return string.gsub(tpl, '(.*/)(.*)', '%2') == templatename .. '.html'
end
)
return _template
end
return template