aboutsummaryrefslogtreecommitdiffstats
path: root/internal/gopherproxy/tpl/gemini.html
diff options
context:
space:
mode:
Diffstat (limited to 'internal/gopherproxy/tpl/gemini.html')
-rw-r--r--internal/gopherproxy/tpl/gemini.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/internal/gopherproxy/tpl/gemini.html b/internal/gopherproxy/tpl/gemini.html
new file mode 100644
index 0000000..8d20da1
--- /dev/null
+++ b/internal/gopherproxy/tpl/gemini.html
@@ -0,0 +1,65 @@
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 }} - Gemini 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">gemini://</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 <div class="action"><button class="settings-btn">Settings</button></div>
27 </div>
28 </header>
29
30 <main class="wrap">
31 <div class="content{{ if not .IsPlain }} content--has-type-annotations{{ end }}">
32 {{- range .Sections -}}
33 {{- if eq .Type "RAW_TEXT" -}}
34 <div class="section"><span class="section__type">```</span><pre class="section__content">{{- .Text -}}</pre></div>
35 {{- else if eq .Type "REFLOW_TEXT" -}}
36 <div class="section"><p class="section__content">{{- .Text -}}</p></div>
37 {{- else if eq .Type "LINK" -}}
38 {{- $linkCls := "link" -}}
39 {{- $url := string .URL -}}
40 {{- if or (hasSuffix $url ".jpg") (hasSuffix $url ".jpeg") (hasSuffix $url ".png") (hasSuffix $url ".gif") -}}
41 {{- $linkCls = "link--IMG" -}}
42 {{- end -}}
43 <div class="section"><span class="section__type"> =></span><a class="section__content {{ $linkCls }}" href="{{ .URL }}">{{- .Text -}}</a></div>
44 {{- else if eq .Type "HEADING_1" -}}
45 <div class="section"><span class="section__type"> #</span><h1 class="section__content">{{- .Text -}}</h1></div>
46 {{- else if eq .Type "HEADING_2" -}}
47 <div class="section"><span class="section__type"> ##</span><h2 class="section__content">{{- .Text -}}</h2></div>
48 {{- else if eq .Type "HEADING_3" -}}
49 <div class="section"><span class="section__type">###</span><h3 class="section__content">{{- .Text -}}</h3></div>
50 {{- else if eq .Type "LIST" -}}
51 <div class="section"><ul class="section__content">
52 {{- range .Items -}}
53 <li>{{- . -}}</li>
54 {{- end -}}
55 </ul></div>
56 {{- end -}}
57 {{- end -}}
58 </div>
59 </main>
60
61 {{- template "_modals.html" . -}}
62
63 <script src="{{ .Assets.JS }}"></script>
64 </body>
65</html>