aboutsummaryrefslogtreecommitdiffstats
path: root/template.go
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-11-11 22:04:20 +0100
committerFeuerfuchs <git@feuerfuchs.dev>2019-11-11 22:04:20 +0100
commitcd8943a3f9e0cbdfe02bdfcdc0393946c9265731 (patch)
tree4c10ed5ce71d3ff9d13f626877507bde904e7098 /template.go
parentPrefix instead of equality to determine page type (diff)
downloadgopherproxy-cd8943a3f9e0cbdfe02bdfcdc0393946c9265731.tar.gz
gopherproxy-cd8943a3f9e0cbdfe02bdfcdc0393946c9265731.tar.bz2
gopherproxy-cd8943a3f9e0cbdfe02bdfcdc0393946c9265731.zip
Fix: Correctly handle URIs where the type is not separated by a slash
Diffstat (limited to 'template.go')
-rw-r--r--template.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/template.go b/template.go
index f58349e..7aee61a 100644
--- a/template.go
+++ b/template.go
@@ -43,6 +43,11 @@ var tpltext = `<!doctype html>
43 <a href="{{ $href }}" class="location__uripart">{{ . }}</a> 43 <a href="{{ $href }}" class="location__uripart">{{ . }}</a>
44 {{- else -}} 44 {{- else -}}
45 {{- $href = printf "%s/1" $href -}} 45 {{- $href = printf "%s/1" $href -}}
46 {{- $part = $part | trimLeftChar -}}
47 {{- if not (eq $part "") -}}
48 {{- $href = printf "%s/%s" $href $part -}}
49 <span class="location__slash">/</span><a href="{{ $href }}" class="location__uripart">{{ $part }}</a>
50 {{- end -}}
46 {{- end -}} 51 {{- end -}}
47 {{- end -}} 52 {{- end -}}
48 {{- if ne (len $uriParts) 0 -}} 53 {{- if ne (len $uriParts) 0 -}}