lens @ 5168a9476f0e83264ecafc85bc9145e8bdcbb8dc

 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 
15    func FromUInttoString(u *uint) string {
16        if u != nil {
17            return strconv.FormatUint(uint64(*u), 10)
18        }
19        return ""
20    }
21%}
22
23
24Page prints a page implementing Page interface.
25{% func PageTemplate(p Page) %}
26<html lang="en">
27    <head>
28        <meta charset="utf-8">
29        <title>img | {%= p.Title() %}</title> 
30        <link rel="stylesheet" href="/static/main.css">
31        <link rel="icon" href="/static/square.svg" sizes="any" type="image/svg+xml">
32        <meta name="viewport" content="width=device-width, initial-scale=1" />
33    </head>
34    <body>
35        <nav class="navbar">
36            <div class="navbar-start">
37                <a href="/fs/" class="navbar-item">
38                    files
39                </a>
40                <a href="/media/" class="navbar-item">
41                    media
42                </a>
43                <a href="/settings/" class="navbar-item">
44                    settings
45                </a>
46            </div>
47        </nav>
48        <div class="container">
49            {%= p.Content() %}
50        </div>
51    </body>
52    {%= p.Script() %}
53</html>
54{% endfunc %}
55
56{% code type BasePage struct {} %}
57{% func (p *BasePage) Title() %}Empty{% endfunc %}
58{% func (p *BasePage) Body() %}HelloWorld{% endfunc %}
59{% func (p *BasePage) Script() %}{% endfunc %}