blob: c419830ddd0e603a393ef0c4930e2ef1671b2583 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
local tk = require 'toolkit'
function get_blog_links()
local links = '<ul>\n'
local pages = tk.pages('blog/')
table.sort(pages, function(a, b) return a.date > b.date end)
for _, page in pairs(pages) do
links = links ..
string.format('<li><a href="%s">[%s] %s</a></li>\n', page.href, page.date, page.title)
end
return links..'</ul>'
end
local md = string.format([[
home
====
welcome to sanine.net!
%s
[subscribe via rss](/rss.xml)
]], get_blog_links())
return {
title='home',
layout='base',
markdown=md,
}
|