61 lines
1.5 KiB
HTML
61 lines
1.5 KiB
HTML
{{ define "main" }}
|
||
{{ $start_date := .Params.start_date }}
|
||
{{ $end_date := .Params.end_date }}
|
||
|
||
{{ $dispatches := slice }}
|
||
|
||
{{ range (sort (.Site.RegularPages.RelatedTo (keyVals "tags" "dispatch")) "Date" "asc") }}
|
||
{{ if lt (time.Format "2006-01-02" .Date) (time.Format "2006-01-02" $start_date) }}
|
||
{{ continue }}
|
||
{{ end }}
|
||
|
||
{{ if gt (time.Format "2006-01-02" .Date) (time.Format "2006-01-02" $end_date) }}
|
||
{{ continue }}
|
||
{{ end }}
|
||
|
||
{{ $dispatches = $dispatches | append . }}
|
||
{{ end }}
|
||
|
||
<section class="page-break">
|
||
Dispatches, {{ time.Format "January 2006" $start_date }} – {{ time.Format "January 2006" $end_date }}
|
||
</section>
|
||
|
||
{{ range $dispatches }}
|
||
<section class="page-break">
|
||
<h2>
|
||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||
</h2>
|
||
|
||
<h3>
|
||
Posted {{ .Date | time.Format "2006-01-02" }}
|
||
</h3>
|
||
|
||
{{ replaceRE `<audio controls src="((.*)/(.*).mp3)"></audio>` "<a href=\"$1\">$3</a> ($1)" .Content | safeHTML }}
|
||
</section>
|
||
{{ end }}
|
||
|
||
{{ $linkRE := `(?s)<a[^>]+?href="(.+?)"[^>]*?>.*?</a>` }}
|
||
|
||
<h2>References</h2>
|
||
|
||
{{ range $dispatches }}
|
||
<p>{{ .Title }}</p>
|
||
|
||
<ol>
|
||
<li>{{ .RelPermalink }}</li>
|
||
|
||
{{ range findRE $linkRE .Content }}
|
||
{{ if findRE `<img` . }}
|
||
{{ continue }}
|
||
{{ end }}
|
||
|
||
{{ if findRE `href="#` . }}
|
||
{{ continue }}
|
||
{{ end }}
|
||
|
||
<li>{{ replaceRE $linkRE "$1" . }}</li>
|
||
{{ end }}
|
||
</ol>
|
||
{{ end }}
|
||
{{ end }}
|