1This is a base page template. All the other template pages implement this interface.
2
3{% import "strconv" %}
4
5{% interface
6Page {
7 Title()
8 Content()
9 Script()
10}
11
12%}
13
14{% code func FromUInttoString(u *uint) string {
15 if u != nil {
16 return strconv.FormatUint(uint64(*u), 10)
17 }
18 return ""
19 }
20%}
21
22{% code
23 var Slug = ""
24%}
25
26Page prints a page implementing Page interface.
27{% func PageTemplate(p Page) %}
28<html lang="en">
29 <head>
30 <meta charset="utf-8">
31 <link rel="icon" href="data:,">
32 <title>cerrado | {%= p.Title() %}</title>
33 <link rel="stylesheet" href="/static/main{%s Slug%}.css">
34 <meta name="viewport" content="width=device-width, initial-scale=1" />
35 </head>
36 <body>
37 <nav class="container navbar navbar-expand-sm">
38 <div class="navbar-nav">
39 <a class="nav-link" href="/git">git</a>
40 <a class="nav-link" href="/list">list</a>
41 <a class="nav-link" href="/about">about</a>
42 <a class="nav-link" href="/config">config</a>
43 </div>
44 </nav>
45 <div class="container">
46 {%= p.Content() %}
47 </div>
48 </body>
49 {%= p.Script() %}
50</html>
51{% endfunc %}
52
53{% code type BasePage struct {} %}
54{% func (p *BasePage) Title() %}Empty{% endfunc %}
55{% func (p *BasePage) Body() %}HelloWorld{% endfunc %}
56{% func (p *BasePage) Script() %}{% endfunc %}