diff options
-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 |