slackbuilds_ponce/development/cgit/config/email-libravatar-korg.lua
Matteo Bernardini e3e3ccdfeb development/cgit: Updated for version 0.10.1.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2014-03-21 13:01:21 -05:00

15 lines
498 B
Lua

local md5 = require("md5")
function filter_open(email, page)
buffer = ""
hexdigest = md5.sumhexa(email:sub(2, -2):lower())
end
function filter_close()
html("<span class='libravatar'><img class='inline' src='//seccdn.libravatar.org/avatar/" .. hexdigest .. "?s=13&d=retro' /><img class='onhover' src='//seccdn.libravatar.org/avatar/" .. hexdigest .. "?s=128&d=retro' /></span>" .. buffer)
return 0
end
function filter_write(str)
buffer = buffer .. str
end