Mercurial Hosting > chat
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:fddd11ae516c |
---|---|
1 local Luan = require "luan:Luan.luan" | |
2 local error = Luan.error | |
3 local ipairs = Luan.ipairs or error() | |
4 | |
5 | |
6 local Shared = {} | |
7 | |
8 function Shared.head() | |
9 %> | |
10 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
11 <style> | |
12 @import "/site.css"; | |
13 </style> | |
14 <% | |
15 end | |
16 | |
17 local function header(crumbs) | |
18 %> | |
19 <div header> | |
20 <a href="/">Reactionary Chat</a> | |
21 <% for _, crumb in ipairs(crumbs or {}) do %> | |
22 / <%=crumb%> | |
23 <% end %> | |
24 </div> | |
25 <% | |
26 end | |
27 Shared.header = header | |
28 | |
29 function Shared.private_header() | |
30 header{ | |
31 [[<a href="/private/">private</a>]] | |
32 [[<a href="/private/tools/">tools</a>]] | |
33 } | |
34 end | |
35 | |
36 return Shared |