aboutsummaryrefslogtreecommitdiffstats
path: root/internal/port/tpl/gopher.html
blob: 6eb607c3b329a8c0cf94a4c40bbb94cbb7c4b27c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>{{ .Title }} - Gopher proxy</title>
		<link rel="stylesheet" href="{{ .Assets.Style }}" />
		{{- template "_fonts.html" . -}}
	</head>
	<body class="{{ if .IsPlain }}is-plain{{ end }}">
		<header class="header header-base">
      <div class="location">
        <a class="location__prefix">gopher://</a><a class="location__prefix location__prefix--mobile">://</a>
        {{- range $i, $item := .Nav -}}
          {{- if ne $i 0 -}}
            <span class="location__slash">/</span>
          {{- end -}}
          {{- if .Current -}}
            <span class="location__uripart">{{ .Label }}</span>
          {{- else -}}
            <a href="{{ .URL }}/" class="location__uripart">{{ .Label }}</a>
          {{- end -}}
        {{- end -}}
      </div>
      <div class="actions">
        {{- if .IsPlain -}}
          <div class="action"><a href="/gopher/{{ .URL | replace "^([^/]*)/0" "$1/9" }}">View raw</a></div>
        {{- end -}}
        <div class="action"><button class="settings-btn">Settings</button></div>
      </div>
    </header>

		<main class="wrap">
      <div class="content content--monospace{{ if not .IsPlain }} content--has-type-annotations{{ end }}">
        {{- $page := . -}}
        {{- range .Lines -}}
          {{- if .Link -}}
            <div class="section"><span class="section__type">{{- .Type -}}</span><a class="section__content link link--{{ .Type }}" href="{{ .Link }}">{{- .Text -}}</a></div>
          {{- else -}}
            <div class="section"><span class="section__type"></span><pre class="section__content">{{- .Text -}}</pre></div>
          {{- end -}}
        {{- end -}}
			</div>
		</main>

		{{- template "_modals.html" . -}}

		<script src="{{ .Assets.JS }}"></script>
	</body>
</html>