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
23Page prints a page implementing Page interface.
24{% func PageTemplate(p Page) %}
25<html lang="en">
26 <head>
27 <meta charset="utf-8">
28 <link rel="icon" href="data:,">
29 <title>cerrado | {%= p.Title() %}</title>
30 <link rel="stylesheet" href="/static/main.css">
31 <meta name="viewport" content="width=device-width, initial-scale=1" />
32 </head>
33 <body>
34 <nav class="container navbar navbar-expand-sm">
35 <ul class="navbar-nav">
36 <li class="nav-link" href="/git">git</li>
37 <li class="nav-link" href="/list">list</li>
38 <li class="nav-link" href="/about">about</li>
39 </ul>
40 </nav>
41 <div class="container">
42 {%= p.Content() %}
43 </div>
44 </body>
45 {%= p.Script() %}
46</html>
47{% endfunc %}
48
49{% code type BasePage struct {} %}
50{% func (p *BasePage) Title() %}Empty{% endfunc %}
51{% func (p *BasePage) Body() %}HelloWorld{% endfunc %}
52{% func (p *BasePage) Script() %}{% endfunc %}