From 749c1789ee6d8537cd9645be0d39415291677182 Mon Sep 17 00:00:00 2001 From: bie Date: Sun, 2 Jul 2017 16:10:01 +0200 Subject: maker maker maker --- config.def.lua | 21 ++++++++++----------- maker | 14 ++++++++++++++ nova/article.html | 35 ----------------------------------- nova/index.html | 7 ------- nova/layout.html | 49 ------------------------------------------------- 5 files changed, 24 insertions(+), 102 deletions(-) delete mode 100644 nova/article.html delete mode 100644 nova/index.html delete mode 100644 nova/layout.html diff --git a/config.def.lua b/config.def.lua index c4f2d80..6b251c5 100644 --- a/config.def.lua +++ b/config.def.lua @@ -1,16 +1,15 @@ config.title = "~maker~" -config.input = "/srv/artikler" -config.output = "/srv/www" -config.css = "/maker.css" +config.templates = "templates" +config.blueprints = "blueprints" +config.src = "artikler" +config.www = "www" +config.date = "%A %d. %B %Y, kl. %H.%M" -config.nav = [[ - -]] +config.base = "http://localhost/" +config.extension = ".html" -config.footer = [[ - -]] +config.static = { + { src = 'sendeplan.yaml', template = 'sendeplan', path = 'sendeplan.html' } +} diff --git a/maker b/maker index 043975c..c0ae292 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" @@ -68,3 +70,15 @@ for n=1,8 do 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 + diff --git a/nova/article.html b/nova/article.html deleted file mode 100644 index 6e82369..0000000 --- a/nova/article.html +++ /dev/null @@ -1,35 +0,0 @@ -
-

- -

{{title}}

- -
- - -
- {{#lead}} -

{{lead}} - {{/lead}} - {{&text}} -

-
-
- diff --git a/nova/index.html b/nova/index.html deleted file mode 100644 index 97ef595..0000000 --- a/nova/index.html +++ /dev/null @@ -1,7 +0,0 @@ -{{#articles}} -
-

-

{{title}}

-
-{{/articles}} - diff --git a/nova/layout.html b/nova/layout.html deleted file mode 100644 index e9b5c83..0000000 --- a/nova/layout.html +++ /dev/null @@ -1,49 +0,0 @@ - - -{{site.title}} - - - - - - - - - - - - - - - - -
-

- -
-
- - -
- -
-{{&_}} -
- - - -- cgit v1.0