cerrado @ 349a3d1ff36a436261b1b65b870f8f262f06584f

 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        <title>cerrado | {%= p.Title() %}</title> 
29        <link rel="stylesheet" href="/static/main.css">
30        <meta name="viewport" content="width=device-width, initial-scale=1" />
31    </head>
32    <body>
33        <nav class="navbar navbar-expand bg-body-tertiary">
34          <div class="container-fluid">
35            <div class="collapse navbar-collapse">
36              <div class="navbar-nav">
37                <a class="nav-link" href="/git">git</a>
38                <a class="nav-link" href="/list">list</a>
39              </div>
40            </div>
41          </div>
42        </nav>
43        <div class="container">
44            {%= p.Content() %}
45        </div>
46    </body>
47    {%= p.Script() %}
48</html>
49{% endfunc %}
50
51{% code type BasePage struct {} %}
52{% func (p *BasePage) Title() %}Empty{% endfunc %}
53{% func (p *BasePage) Body() %}HelloWorld{% endfunc %}
54{% func (p *BasePage) Script() %}{% endfunc %}