comparison 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
comparison
equal deleted inserted replaced
0:c604a58600be 1:da780d885325
1 local Luan = require "luan:Luan.luan" 1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error 2 local error = Luan.error
3 local ipairs = Luan.ipairs or error()
3 4
4 5
5 local Shared = {} 6 local Shared = {}
6 7
7 function Shared.head() 8 function Shared.head()
11 @import "/site.css"; 12 @import "/site.css";
12 </style> 13 </style>
13 <% 14 <%
14 end 15 end
15 16
16 function Shared.header() 17 local function header(crumbs)
17 %> 18 %>
18 <div header> 19 <div header>
19 <a href="/">Reactionary Software</a> 20 <a href="/">Reactionary Software</a>
21 <% for _, crumb in ipairs(crumbs or {}) do %>
22 / <%=crumb%>
23 <% end %>
20 </div> 24 </div>
21 <% 25 <%
22 end 26 end
27 Shared.header = header
28
29 function Shared.existing_header()
30 header{[[<a href="/existing.html">Existing</a>]]}
31 end
32
33 function Shared.needed_header()
34 header{[[<a href="/needed.html">Needed</a>]]}
35 end
23 36
24 return Shared 37 return Shared