summaryrefslogtreecommitdiff
path: root/maker
diff options
context:
space:
mode:
Diffstat (limited to 'maker')
-rwxr-xr-xmaker18
1 files changed, 16 insertions, 2 deletions
diff --git a/maker b/maker
index b8b9ba6..c6ae2fa 100755
--- a/maker
+++ b/maker
@@ -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)