comparison unsubscribe/src/lib/Shared.luan @ 0:8f4df159f06b

start public repo
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Jul 2025 20:57:49 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f4df159f06b
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local String = require "luan:String.luan"
4 local regex = String.regex or error()
5
6
7 local Shared = {}
8
9 function Shared.head()
10 %>
11 <meta name="viewport" content="width=device-width, initial-scale=1">
12 <style>
13 @import "/site.css";
14 </style>
15 <%
16 end
17
18 function Shared.header()
19 %>
20 <div header>
21 <a header href="https://linkmy.style/">
22 <img logo=big src="https://linkmy.style/images/logo.png">
23 <img logo=small src="https://linkmy.style/images/small_logo.png">
24 </a>
25 </div>
26 <%
27 end
28
29 function Shared.footer()
30 %>
31 <div footer>
32 <span>
33 <a href="https://linkmy.style/help.html">Help</a>
34 <br>support@linkmy.style
35 </span>
36 <span>
37 <a href="https://apps.apple.com/us/app/linkmystyle/id6475133762"><img ios src="https://linkmy.style/images/ios.svg"></a>
38 <a href="https://www.instagram.com/linkmy.style/"><img src="https://linkmy.style/images/icons/instagram.svg"></a>
39 </span>
40 </div>
41 <%
42 end
43
44 local email_regex = regex[[^[-+~.\w]+@[-.\w]+$]]
45
46 function Shared.validate_email(email)
47 email_regex.matches(email) or error("bad email: "..email)
48 end
49
50 return Shared