Home,News: Seperate data and rendering

This commit is contained in:
Tom Wiesing 2023-01-09 14:11:42 +01:00
parent dcd5f910ae
commit a1069f115e
No known key found for this signature in database
10 changed files with 187 additions and 200 deletions

View file

@ -1,46 +0,0 @@
{{ template "_base.html" . }}
{{ define "title" }}WissKI Distillery{{ end }}
{{ define "header"}}
<p>
<a class="pure-button pure-button-primary" href="/">Home</a>
</p>
<p>
<a class="pure-button" href="/news/">News</a>
</p>
{{ end }}
{{ define "content" }}
{{ block "@custom/about" . }}
<div class="pure-u-1">
<p>
For more information, see <a href="{{ .SelfRedirect }}">{{ .SelfRedirect }}</a>.
</p>
</div>
{{ end }}
<div class="pure-u-1">
<h2>WissKIs on this Distillery</h2>
</div>
{{range .Instances}}
{{ if and .Running (not .NoPrefixes) }}
<div class="pure-u-1 pure-u-md-1-3">
<h3>{{.Slug}}</h3>
<p>
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer" class="wisskilink">{{.URL}}</a><br>
<small>
{{ .Statistics.Bundles.Summary }}
{{ $edit := .Statistics.Bundles.LastEdit }}
{{ if $edit.Valid }}
<br />
last edited {{ $edit.Time.Format "2006-01-02T15:04:05Z07:00" }}
{{ end }}
</small>
</p>
</div>
{{ end }}
{{ end }}
{{ end }}