diff options
| author | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-16 21:41:30 +0200 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-16 21:41:30 +0200 |
| commit | f4a0b1388cb77da698ac172039139d6ebd4b10af (patch) | |
| tree | 6a2fb06a910bdfb0f2e1d418b4be8f3fece283d4 /_scripts/generate_index.lua | |
| parent | ce924721d6548080b9963c94660c5bbea3d611a0 (diff) | |
| download | alpine-mksite-f4a0b1388cb77da698ac172039139d6ebd4b10af.tar.bz2 alpine-mksite-f4a0b1388cb77da698ac172039139d6ebd4b10af.tar.xz | |
use lua-lyaml instead of lua-yaml
it seems to be better maintained upstream
Diffstat (limited to '_scripts/generate_index.lua')
| -rw-r--r-- | _scripts/generate_index.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/_scripts/generate_index.lua b/_scripts/generate_index.lua index 84f4051..8e2bc85 100644 --- a/_scripts/generate_index.lua +++ b/_scripts/generate_index.lua @@ -1,16 +1,19 @@ #!/usr/bin/lua markdown = require('discount') -yaml = require('yaml') +lyaml = require('lyaml') +lfs = require('lfs') function read_meta(file) local f = assert(io.open(file)) local header, body = f:read("*a"):match("^(%-%-%-.-%-%-%-)(.*)$") f:close() - local m = yaml.load(header) + local m = lyaml.load(header) m.pagename = file:gsub("%.md$", ""):gsub("^.*/", "") m.md = file m.html = m.pagename..".html" + -- timestamps in Atom must conform to RFC 3339 + m.updated= os.date('!%Y-%m-%dT%H:%M:%SZ', lfs.attributes(file).modification) return m end @@ -27,5 +30,5 @@ end table.sort(a, function(a,b) return a.date > b.date end) -io.write(yaml.dump(a)) +io.write(lyaml.dump{a}) |
