summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbie <bie@blekksprut.net>2017-08-04 07:08:15 +0000
committerbie <bie@blekksprut.net>2017-08-04 07:08:15 +0000
commit44f289b0cc1ab02c9e74379072c6a9a6550a3b5c (patch)
tree5ffc0e899ea12d7898cd4bb0bb2ca22c38c4f66b
parentf1d4dfce67c37626ef0bb993c801dacf4f63849a (diff)
downloadlupin-master.tar.xz
-rwxr-xr-xlupin.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/lupin.lua b/lupin.lua
index a1c31f1..1001894 100755
--- a/lupin.lua
+++ b/lupin.lua
@@ -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