diff options
Diffstat (limited to 'internal/port/tpl/gopher.html')
| -rw-r--r-- | internal/port/tpl/gopher.html | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/internal/port/tpl/gopher.html b/internal/port/tpl/gopher.html index c971847..5436123 100644 --- a/internal/port/tpl/gopher.html +++ b/internal/port/tpl/gopher.html | |||
| @@ -31,25 +31,16 @@ | |||
| 31 | </header> | 31 | </header> |
| 32 | 32 | ||
| 33 | <main class="wrap"> | 33 | <main class="wrap"> |
| 34 | <pre class="content content--has-monospace-font{{ if not .IsPlain }} content--has-type-annotations{{ end }}"> | 34 | <div class="content content--monospace{{ if not .IsPlain }} content--has-type-annotations{{ end }}"> |
| 35 | {{- $content := "" -}} | ||
| 36 | {{- $page := . -}} | 35 | {{- $page := . -}} |
| 37 | {{- range .Lines -}} | 36 | {{- range .Lines -}} |
| 38 | {{- if ne $content "" -}} | 37 | {{- if .Link -}} |
| 39 | {{- $content = printf "%s\n" $content -}} | 38 | <div class="section"><span class="section__type">{{- .Type -}}</span><a class="section__content" href="{{ .Link }}">{{- .Text -}}</a></div> |
| 40 | {{- end -}} | ||
| 41 | {{- if $page.IsPlain -}} | ||
| 42 | {{- $content = printf "%s%s" $content (.Text | HTMLEscape) -}} | ||
| 43 | {{- else -}} | 39 | {{- else -}} |
| 44 | {{- if .Link -}} | 40 | <div class="section"><span class="section__type"></span><pre class="section__content">{{- .Text -}}</pre></div> |
| 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 -}} | 41 | {{- end -}} |
| 50 | {{- end -}} | 42 | {{- end -}} |
| 51 | {{- $content | safeHtml -}} | 43 | </div> |
| 52 | </pre> | ||
| 53 | </main> | 44 | </main> |
| 54 | 45 | ||
| 55 | {{- template "_modals.html" . -}} | 46 | {{- template "_modals.html" . -}} |
