diff options
author | bie <bie@blekksprut.net> | 2017-08-04 07:08:15 +0000 |
---|---|---|
committer | bie <bie@blekksprut.net> | 2017-08-04 07:08:15 +0000 |
commit | 44f289b0cc1ab02c9e74379072c6a9a6550a3b5c (patch) | |
tree | 5ffc0e899ea12d7898cd4bb0bb2ca22c38c4f66b /lupin.lua | |
parent | f1d4dfce67c37626ef0bb993c801dacf4f63849a (diff) | |
download | lupin-master.tar.xz |
Diffstat (limited to 'lupin.lua')
-rwxr-xr-x | lupin.lua | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -5,7 +5,7 @@ http = require 'lcurl' require 'tokyocabinet' require 'corz' -CACHE = "/home/bie/tmp.db" +CACHE = "/srv/tears/embed.db" cache = tokyocabinet.bdbnew() cache:open(CACHE, cache.OWRITER + cache.OREADER) @@ -347,6 +347,14 @@ function lupin.transform(path, format, env, mode) data.group = posix.getgroup(stat.gid).name data.groupname = userfile("navn", data.group, data.group) + if data.published then + data.date = os.date("%A %d. %B %Y, kl. %H.%M", data.published) + else + local root = "/srv/www/happiest.place/tears/artikler" + y, m, d = path:match(root .. "/(.*)/(.*)/(.*)/(.*)") + data.date = ("%s/%s/%s"):format(y, m, d) + end + data.portrait = userurl("selfie.jpg", data.author .. ".jpg", data.author) end |