summaryrefslogtreecommitdiff
path: root/site_root/index.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-01-13 17:41:02 -0600
committersanine <sanine.not@pm.me>2022-01-13 17:41:02 -0600
commit0ff62ea7886bdeff160682d3d5713c2c8a6dd4b1 (patch)
treec70d31f35c1e54a7fc01246eb6740d79aef0ccd0 /site_root/index.lua
initial commit
Diffstat (limited to 'site_root/index.lua')
-rw-r--r--site_root/index.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/site_root/index.lua b/site_root/index.lua
new file mode 100644
index 0000000..cc5f699
--- /dev/null
+++ b/site_root/index.lua
@@ -0,0 +1,28 @@
+local tk = require 'toolkit'
+
+function get_blog_links()
+ local links = '<ul>\n'
+ for _, page in pairs(tk.pages('blog/')) 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,
+}