view src/lib/Shared.luan @ 8:2557b6a696c1

more freedit
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 12 Apr 2022 13:25:45 -0600
parents da780d885325
children f92034a190d1
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local ipairs = Luan.ipairs or error()


local Shared = {}

function Shared.head()
%>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<style>
			@import "/site.css";
		</style>
<%
end

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