summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbie <bie@blekksprut.net>2017-07-02 16:10:01 +0200
committerbie <bie@blekksprut.net>2017-07-02 16:10:01 +0200
commit749c1789ee6d8537cd9645be0d39415291677182 (patch)
tree05ff40f9daef378a53aa76eafb536a34ac3d5710
parent05c51adb090fa096eb229c9cc4f1c519fcda6a01 (diff)
downloadmaker-749c1789ee6d8537cd9645be0d39415291677182.tar.xz
maker maker maker
-rw-r--r--config.def.lua21
-rwxr-xr-xmaker14
-rw-r--r--nova/article.html35
-rw-r--r--nova/index.html7
-rw-r--r--nova/layout.html49
5 files changed, 24 insertions, 102 deletions
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 = [[
-<nav>
-</nav>
-]]
+config.base = "http://localhost/"
+config.extension = ".html"
-config.footer = [[
-<footer>
-</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 @@
-<article class=full>
- <p class=figure data-attribution='{{attribution}}'>
- <a href='{{url}}'><img alt src='{{image}}'></a>
- <h2><a href='{{url}}'>{{title}}</a></h2>
-
- <p class=byline>
- <img alt class='headshot mini' src='{{portrait}}'>
- <span class=navn>
- <a href='/folk/{{author}}'>{{author}}</a>
- for <a href='/group/{{group}}'>{{group}}</a>
- </span>
-
- <section class=content>
- <aside>
- <img alt class=headshot src='{{portrait}}'>
- {{#info}}
- <h3>Om filmen</h3>
- {{/info}}
- {{#info}}
- <dl>
- <dt>{{term}}</dt>
- <dd>{{fact}}</dd>
- </dl>
- {{/info}}
- </aside>
-
- <section class=body>
- {{#lead}}
- <p class=lead><b>{{lead}}</b>
- {{/lead}}
- {{&text}}
- </section>
- </section>
-</article>
-
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}}
- <article>
- <p><a href='{{url}}'><img alt src='{{image}}'></a>
- <h2><a href='{{url}}'>{{title}}</a></h2>
- </article>
-{{/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 @@
-<!doctype html>
-<meta charset=utf-8>
-<title>{{site.title}}</title>
-<meta name=viewport content=width=device-width>
-<meta name=viewport content=initial-scale=1.0>
-
-<link rel=stylesheet href='{{&site.base}}/css/font-awesome.min.css'>
-<link rel=stylesheet href='{{&site.base}}/css/font-awesome-animation.min.css'>
-
-<link rel=stylesheet href='{{&site.base}}/css/open-sans.css'>
-<link rel=stylesheet href='{{&site.base}}/css/noticia.css'>
-
-<link rel=stylesheet href='{{&site.base}}/css/radionova.css'>
-
-<script src='{{&site.base}}/js/jquery.js'></script>
-<script src='{{&site.base}}/js/radionova.js'></script>
-
-<audio id=novastream>
- <source id="hls" src="http://henrik.party/stream/master.m3u8">
- <source id="ogg" src="http://stream.radionova.no/ogg">
- <source id="mp3" src="http://stream.radionova.no/mp3">
-</audio>
-
-<header>
- <h1><a href='/'><img src='{{&site.base}}/radionova.png'></a></h1>
-
- <div class='fa fa-play' id='stream-toggle'></div>
- <div id='stream-playing'></div>
-
- <nav id='site-menu' class='sidebar hidden'>
- <p>
- <a href='/podcast'>Podcast</a>
- <a href='/programmer'>Programmer</a>
- <a href='/a-lista'>A-Lista</a>
- <a href='/a-lista'>Studentnyhetene</a>
- <a href='/a-lista'>Sendeplan</a>
-
- <p>Radio Nova er Oslo-studentenes helt egne radiokanal og en av Norges største lokalradioer.
- <p>24 timer i døgnet, syv dager i uka gir vi deg et vidt spekter av programmer som garantert dekker dine interesser og spiller favorittmusikken din, før du visste at du likte den.
- </nav>
-</header>
-
-<main>
-{{&_}}
-</main>
-
-<footer>
-</footer>
-