2018-02-23 19:52:10 +01:00
|
|
|
<?lua
|
2018-02-24 19:14:46 +01:00
|
|
|
local arg = {...}
|
|
|
|
local datas = arg[1]
|
|
|
|
local order = arg[2]
|
2018-02-25 13:54:37 +01:00
|
|
|
local class = "card"
|
|
|
|
if HEADER.mobile then
|
|
|
|
class = "card mobile"
|
|
|
|
end
|
2018-02-25 02:31:13 +01:00
|
|
|
loadscript(BLOG_ROOT.."/view/top.ls")("Welcome to my blog")
|
2018-02-24 19:14:46 +01:00
|
|
|
if #order == 0 then
|
2018-02-23 19:52:10 +01:00
|
|
|
?>
|
|
|
|
<div class = "notfound">
|
|
|
|
<p>No entry found</p>
|
|
|
|
<blockquote>
|
|
|
|
“In many ways my life has been rather like a record of the lost and found. Perhaps all lives are like that.”
|
|
|
|
<span>― Lucy Foley, The Book of Lost and Found</span>
|
|
|
|
</blockquote >
|
|
|
|
</div>
|
|
|
|
<?lua
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2018-02-24 19:14:46 +01:00
|
|
|
for idx,v in pairs(order) do
|
|
|
|
local data = datas[v]
|
2018-02-23 19:52:10 +01:00
|
|
|
?>
|
2018-02-25 13:54:37 +01:00
|
|
|
<div class = "<?=class?>">
|
2018-02-23 19:52:10 +01:00
|
|
|
<div class = "side">
|
|
|
|
<span class = "date"><?=data.ctimestr:gsub("%s+.*$","")?></span>
|
|
|
|
<span class = "tags">
|
|
|
|
<?lua
|
|
|
|
local atags = {}
|
|
|
|
local i = 1
|
|
|
|
for tag in data.tags:gmatch(",*([^,]+)") do
|
|
|
|
tag = std.trim(tag, " ")
|
2018-02-25 01:57:42 +01:00
|
|
|
if tag ~= "" then
|
|
|
|
local b64tag = std.b64encode(tag)
|
|
|
|
atags[i] = '<a href = "./r:bytag:'..b64tag:gsub("=","")..':'..MAX_ENTRY..'">'..tag.."</a>"
|
|
|
|
i = i+ 1
|
|
|
|
end
|
2018-02-23 19:52:10 +01:00
|
|
|
end
|
|
|
|
echo(table.concat(atags, ", "))
|
|
|
|
?>
|
|
|
|
</span>
|
2018-02-25 16:11:37 +01:00
|
|
|
<div class="fb-like" data-href="https://blog.lxsang.me/r:id:<?=data.id?>" data-layout="button_count" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div>
|
|
|
|
<div class="g-plusone" data-size="medium"></div>
|
|
|
|
<a class="twitter-share-button" href="https://twitter.com/intent/tweet">
|
|
|
|
Tweet</a>
|
2018-02-23 19:52:10 +01:00
|
|
|
</div>
|
|
|
|
<div class = "blogentry">
|
|
|
|
<div class = "shortcontent">
|
|
|
|
<?lua
|
2018-02-25 02:31:13 +01:00
|
|
|
local content = bytes.__tostring(std.b64decode(data.rendered)):gsub("%%","%%%%")
|
2018-02-23 19:52:10 +01:00
|
|
|
local r, s = content:find("(<hr/?>)")
|
2018-02-25 15:19:31 +01:00
|
|
|
local title = nil
|
2018-02-23 19:52:10 +01:00
|
|
|
if r then
|
|
|
|
content = content:sub(0,r-1)
|
|
|
|
end
|
2018-02-25 15:19:31 +01:00
|
|
|
local a,b = content:find("<[Hh]1[^>]*>")
|
|
|
|
local c,d
|
|
|
|
if a then
|
|
|
|
c,d = content:find("</[Hh]1>")
|
|
|
|
if c then
|
|
|
|
title = content:sub(b+1, c-1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if title then
|
|
|
|
echo(content:sub(0, b))
|
|
|
|
echo("<a class = 'title_link' href='./r:id:"..data.id.."'>"..title.."</a>")
|
|
|
|
echo(content:sub(c))
|
|
|
|
else
|
|
|
|
echo(content)
|
|
|
|
end
|
2018-02-23 19:52:10 +01:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class = "detail">
|
|
|
|
<span></span>
|
2018-02-25 01:57:42 +01:00
|
|
|
<?='<a href="./r:id:'..data.id..'" ></a>'?>
|
2018-02-23 19:52:10 +01:00
|
|
|
<span></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?lua
|
|
|
|
end
|
|
|
|
?>
|