annotate src/lib/Shared.luan @ 28:c6a350363bb6

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 02 Dec 2022 17:11:31 -0700
parents da780d885325
children f92034a190d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
3 local ipairs = Luan.ipairs or error()
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Shared = {}
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 function Shared.head()
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 <meta name="viewport" content="width=device-width, initial-scale=1">
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 <style>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 @import "/site.css";
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 </style>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <%
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 end
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
17 local function header(crumbs)
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 <div header>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 <a href="/">Reactionary Software</a>
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
21 <% for _, crumb in ipairs(crumbs or {}) do %>
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
22 / <%=crumb%>
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
23 <% end %>
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 </div>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 <%
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 end
1
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
27 Shared.header = header
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
28
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
29 function Shared.existing_header()
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
30 header{[[<a href="/existing.html">Existing</a>]]}
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
31 end
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
32
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
33 function Shared.needed_header()
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
34 header{[[<a href="/needed.html">Needed</a>]]}
Franklin Schmidt <fschmidt@gmail.com>
parents: 0
diff changeset
35 end
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37 return Shared