diff options
Diffstat (limited to 'internal/port/tpl/gopher.html')
-rw-r--r-- | internal/port/tpl/gopher.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/internal/port/tpl/gopher.html b/internal/port/tpl/gopher.html index e69de29..c971847 100644 --- a/internal/port/tpl/gopher.html +++ b/internal/port/tpl/gopher.html | |||
@@ -0,0 +1,59 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <meta charset="utf-8"> | ||
5 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
6 | <title>{{ .Title }} - Gopher proxy</title> | ||
7 | <link rel="stylesheet" href="{{ .Assets.Style }}" /> | ||
8 | {{- template "_fonts.html" . -}} | ||
9 | </head> | ||
10 | <body class="{{ if .IsPlain }}is-plain{{ end }}"> | ||
11 | <header class="header header-base"> | ||
12 | <div class="location"> | ||
13 | <a class="location__prefix">gopher://</a><a class="location__prefix location__prefix--mobile">://</a> | ||
14 | {{- range $i, $item := .Nav -}} | ||
15 | {{- if ne $i 0 -}} | ||
16 | <span class="location__slash">/</span> | ||
17 | {{- end -}} | ||
18 | {{- if .Current -}} | ||
19 | <span class="location__uripart">{{ .Label }}</span> | ||
20 | {{- else -}} | ||
21 | <a href="{{ .URL }}/" class="location__uripart">{{ .Label }}</a> | ||
22 | {{- end -}} | ||
23 | {{- end -}} | ||
24 | </div> | ||
25 | <div class="actions"> | ||
26 | {{- if .IsPlain -}} | ||
27 | <div class="action"><a href="/gopher/{{ .URL | replace "^([^/]*)/0" "$1/9" }}">View raw</a></div> | ||
28 | {{- end -}} | ||
29 | <div class="action"><button class="settings-btn">Settings</button></div> | ||
30 | </div> | ||
31 | </header> | ||
32 | |||
33 | <main class="wrap"> | ||
34 | <pre class="content content--has-monospace-font{{ if not .IsPlain }} content--has-type-annotations{{ end }}"> | ||
35 | {{- $content := "" -}} | ||
36 | {{- $page := . -}} | ||
37 | {{- range .Lines -}} | ||
38 | {{- if ne $content "" -}} | ||
39 | {{- $content = printf "%s\n" $content -}} | ||
40 | {{- end -}} | ||
41 | {{- if $page.IsPlain -}} | ||
42 | {{- $content = printf "%s%s" $content (.Text | HTMLEscape) -}} | ||
43 | {{- else -}} | ||
44 | {{- if .Link -}} | ||
45 | {{- $content = printf "%s%s" $content (printf "<span class=\"type-annotation\">%s </span><a class=\"link link--%s\" href=\"%s\">%s</a>" .Type .Type .Link (.Text | HTMLEscape)) -}} | ||
46 | {{- else -}} | ||
47 | {{- $content = printf "%s%s" $content (printf "<span class=\"type-annotation\"> </span>%s" (.Text | HTMLEscape)) -}} | ||
48 | {{- end -}} | ||
49 | {{- end -}} | ||
50 | {{- end -}} | ||
51 | {{- $content | safeHtml -}} | ||
52 | </pre> | ||
53 | </main> | ||
54 | |||
55 | {{- template "_modals.html" . -}} | ||
56 | |||
57 | <script src="{{ .Assets.JS }}"></script> | ||
58 | </body> | ||
59 | </html> | ||