diff options
Diffstat (limited to 'maker')
-rwxr-xr-x | maker | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -3,6 +3,8 @@ lfs = require "lfs" posix = require "posix" lustache = require "lustache" +yaml = require 'yaml' +yaml.configure{ load_numeric_scalars = false } require "lupin" require "corz" @@ -22,7 +24,7 @@ function build(path, id, data) io.output() end -local finder = "find %s -readable -not -iname '*~' -type f | sort -rn" +local finder = "find %s -perm /o+r -readable -not -iname '*~' -type f | sort -rn" local files = {} for file in io.popen(finder:format(config.src)):read("*a"):gmatch("[^\n]+") do table.insert(files, file) @@ -66,5 +68,17 @@ for n=1,8 do table.insert(page.articles, data) end end -build(path, "index", page) +for i, page in ipairs(config.static) do + local path = config.www .. "/" .. page.path + local data = nil + if type(page.src) == "string" then + data = yaml.loadpath(page.src) + else + data = page.src() + end + data.site = config + build(path, page.template, data) +end + +build(path, "index", page) |