improve blogroll template

This commit is contained in:
Jan-Lukas Else 2021-05-10 20:34:30 +02:00
parent c8c848daf5
commit d7da17bda1
1 changed files with 6 additions and 2 deletions

View File

@ -9,10 +9,14 @@
<p><a href="{{ blogrelative .Blog .Data.Download }}" class="button" download>{{ string .Blog.Lang "download" }}</a></p>
{{ $lang := .Blog.Lang }}
{{ range .Data.Outlines }}
<h2>{{ with .Title }}{{ . }}{{ else }}{{ with .Text }}{{ . }}{{ end }}{{ end }}</h2>
{{ $title := .Title }}
{{ if not $title }}{{ $title = .Text }}{{ end }}
<h2 id="{{ urlize $title }}">{{ $title }}</h2>
<ul>
{{ range .Outlines }}
<li><a href="{{ urlToString .HTMLURL }}" target="_blank">{{ with .Title }}{{ . }}{{ else }}{{ with .Text }}{{ . }}{{ end }}{{ end }}</a> (<a href="{{ urlToString .XMLURL }}" target="_blank">{{ string $lang "feed" }}</a>)</li>
{{ $ct := .Title }}
{{ if not $ct }}{{ $ct = .Text }}{{ end }}
<li><a href="{{ urlToString .HTMLURL }}" target="_blank">{{ $ct }}</a> (<a href="{{ urlToString .XMLURL }}" target="_blank">{{ string $lang "feed" }}</a>)</li>
{{ end }}
</ul>
{{ end }}