summaryrefslogtreecommitdiff
path: root/data/index.md
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-01-12 17:24:25 -0600
committersanine <sanine.not@pm.me>2023-01-12 17:24:25 -0600
commit655cd79991ec9204afb9f5acf52495c13af14d25 (patch)
treec2f441e09ce65337bb622183107a77c40c0dad0b /data/index.md
parent35de9c18b9c9ce7d466e5aecec0b4becde2795bb (diff)
begin go refactorgo-dynamic
Diffstat (limited to 'data/index.md')
-rw-r--r--data/index.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/data/index.md b/data/index.md
new file mode 100644
index 0000000..c419830
--- /dev/null
+++ b/data/index.md
@@ -0,0 +1,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,
+}