summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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