1This is a base page template. All the other template pages implement this interface.
2
3{% import "strconv" %}
4{% import "time" %}
5
6{% code
7 var Slug = ""
8%}
9
10{% interface
11Page {
12 Title()
13 Content()
14 Script()
15 Navbar()
16}
17%}
18
19
20{% code func FromUInttoString(u *uint) string {
21 if u != nil {
22 return strconv.FormatUint(uint64(*u), 10)
23 }
24 return ""
25 }
26%}
27
28{% code func TimeFormat(t time.Time) string {
29 return t.Format("02.01.2006")
30 }
31%}
32
33{% code func Ignore[T any](v T, _ error) T {
34 return v
35 }
36%}
37
38Page prints a page implementing Page interface.
39{% func PageTemplate(p Page) %}
40<!DOCTYPE html>
41<html lang="en">
42 <head>
43 <meta charset="utf-8">
44 <link rel="icon" href="data:,">
45 <title>{%= p.Title() %}</title>
46 <link rel="stylesheet" href="/static/main{%s Slug%}.css">
47 <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
48 <meta name="viewport" content="width=device-width, initial-scale=1" />
49 </head>
50 <body>
51 <div class="alert alert-warning text-center" role="alert">
52 This project is under development, things may be broken or incomplete.
53 </div>
54 {%= p.Navbar() %}
55 <div class="container">
56 {%= p.Content() %}
57 </div>
58 </body>
59 {%= p.Script() %}
60</html>
61{% endfunc %}