Mercurial Hosting > chat
diff src/lib/Shared.luan @ 0:fddd11ae516c
start
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 23 Oct 2024 13:13:07 -0600 |
parents | |
children | b116b6ef07bf |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lib/Shared.luan Wed Oct 23 13:13:07 2024 -0600 @@ -0,0 +1,36 @@ +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 Chat</a> +<% for _, crumb in ipairs(crumbs or {}) do %> + / <%=crumb%> +<% end %> + </div> +<% +end +Shared.header = header + +function Shared.private_header() + header{ + [[<a href="/private/">private</a>]] + [[<a href="/private/tools/">tools</a>]] + } +end + +return Shared