summaryrefslogtreecommitdiff
path: root/h.lua
diff options
context:
space:
mode:
Diffstat (limited to 'h.lua')
-rw-r--r--h.lua45
1 files changed, 28 insertions, 17 deletions
diff --git a/h.lua b/h.lua
index 5c62e66..16ccb21 100644
--- a/h.lua
+++ b/h.lua
@@ -88,7 +88,7 @@ function qw(s)
for a in s:gmatch("%w+") do table.insert(t,a) end
return t
end
-local tnames = qw"h1 h2 p b ul li dl dt dd div section header figure figcaption img title"
+local tnames = qw"h1 h2 p b ul ol li dl dt dd div section header figure figcaption img title nav"
for _,n in ipairs(tnames) do
_G[n] = tagfn(n)
end
@@ -110,22 +110,33 @@ function mkhead(t)
}
end
--- the box at the top with the cool picture of me in, etc
--- presumably the same on all pages
-site_top = header {
- img({id="me",src="/me.png"},""),
- h1 "ubq323's website",
- p [[rebecca, "ubq323" (she/her, 20) - eminently engromulent]],
-}
+function mktopbox(imgsrc,name,rest)
+ return header {
+ img({id='me',src=imgsrc},''),
+ h1(name),
+ rest
+ }
+end
+function bcrumb(items)
+ -- items are {text,href}
+ local lis = {}
+ for _,it in ipairs(items) do
+ if it[2] then
+ table.insert(lis, li(a(it[1],it[2])))
+ else
+ table.insert(lis,li(it[1]))
+ end
+ end
+ return nav(
+ {class='breadcrumb',['aria-label']='Breadcrumb'},
+ ol(lis)
+ )
+end
-function blogpost(meta, content)
- -- creates a whole page
+-- the box at the top with the cool picture of me in, etc
+-- presumably the same on all pages
+site_top = mktopbox('/me.png',"ubq323's website",
+ p [[rebecca, "ubq323" (she/her, 20) - eminently engromulent]]
+)
- return {
- mkhead(meta.title),
- site_top,
- section(content),
- -- maybe footer?
- }
-end