diff options
Diffstat (limited to 'template.go')
-rw-r--r-- | template.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/template.go b/template.go index ac7f674..cdef279 100644 --- a/template.go +++ b/template.go | |||
@@ -27,11 +27,12 @@ var tpltext = `<!doctype html> | |||
27 | {{- $uriParts = $uriParts | pop -}} | 27 | {{- $uriParts = $uriParts | pop -}} |
28 | {{- end -}} | 28 | {{- end -}} |
29 | 29 | ||
30 | <button class="location__prefix">gopher://</button> {{ range $i, $part := $uriParts -}} | 30 | <button class="location__prefix">gopher://</button> |
31 | {{- range $i, $part := $uriParts -}} | ||
31 | {{- if ne $i 1 -}} | 32 | {{- if ne $i 1 -}} |
32 | {{- $href = printf "%s/%s" $href . -}} | 33 | {{- $href = printf "%s/%s" $href . -}} |
33 | {{- if ne $i 0 -}} | 34 | {{- if ne $i 0 -}} |
34 | <span class="location__slash"> / </span> | 35 | <span class="location__slash">/</span> |
35 | {{- end -}} | 36 | {{- end -}} |
36 | <a href="{{ $href }}" class="location__uripart">{{ . }}</a> | 37 | <a href="{{ $href }}" class="location__uripart">{{ . }}</a> |
37 | {{- else -}} | 38 | {{- else -}} |
@@ -39,11 +40,11 @@ var tpltext = `<!doctype html> | |||
39 | {{- end -}} | 40 | {{- end -}} |
40 | {{- end -}} | 41 | {{- end -}} |
41 | {{- if ne (len $uriParts) 0 -}} | 42 | {{- if ne (len $uriParts) 0 -}} |
42 | <span class="location__slash"> / </span> | 43 | <span class="location__slash">/</span> |
43 | {{- end -}} | 44 | {{- end -}} |
44 | <span class="location__uripart">{{ $uriLast -}}</span> | 45 | <span class="location__uripart">{{ $uriLast -}}</span> |
45 | </div> | 46 | </div> |
46 | <div> | 47 | <div class="actions"> |
47 | {{- if not .Lines }}<a href="/{{ .URI | replace "^(.*?)/0" "$1/9" }}">View raw</a> | {{ end -}} | 48 | {{- if not .Lines }}<a href="/{{ .URI | replace "^(.*?)/0" "$1/9" }}">View raw</a> | {{ end -}} |
48 | <button class="settings-btn">Settings</button> | 49 | <button class="settings-btn">Settings</button> |
49 | </div> | 50 | </div> |