diff src/lib/Shared.luan @ 1:da780d885325

more
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 07 Apr 2022 19:54:29 -0600
parents c604a58600be
children f92034a190d1
line wrap: on
line diff
--- a/src/lib/Shared.luan	Thu Apr 07 16:06:10 2022 -0600
+++ b/src/lib/Shared.luan	Thu Apr 07 19:54:29 2022 -0600
@@ -1,5 +1,6 @@
 local Luan = require "luan:Luan.luan"
 local error = Luan.error
+local ipairs = Luan.ipairs or error()
 
 
 local Shared = {}
@@ -13,12 +14,24 @@
 <%
 end
 
-function Shared.header()
+local function header(crumbs)
 %>
 		<div header>
 			<a href="/">Reactionary Software</a>
+<%	for _, crumb in ipairs(crumbs or {}) do %>
+			/ <%=crumb%>
+<%	end %>
 		</div>
 <%
 end
+Shared.header = header
+
+function Shared.existing_header()
+	header{[[<a href="/existing.html">Existing</a>]]}
+end
+
+function Shared.needed_header()
+	header{[[<a href="/needed.html">Needed</a>]]}
+end
 
 return Shared