davideisinger.com

My personal website
Log | Files | Refs | README

commit 749435298ec5e89926e0e9a3a19694a2f5d6e755
parent 30cd4499f30c3e79ab8f99e447e374d5e82c861c
Author: David Eisinger <[email protected]>
Date:   Fri, 10 Jan 2025 22:35:09 -0500

List references at end of archive

Diffstat:
Mthemes/v2/assets/css/style.scss | 13-------------
Mthemes/v2/layouts/archive/single.html | 46++++++++++++++++++++++++++++++++++++++--------
2 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/themes/v2/assets/css/style.scss b/themes/v2/assets/css/style.scss @@ -234,19 +234,6 @@ audio::-webkit-media-controls-panel { display: none; } - a:not(:has(img), [href^="#"], [href="/"]) { - border-bottom: 1.5px solid #00a; - text-decoration: none; - - &::after { - border-bottom: 1.5px solid white; - color: #eee; - content: " [" attr(href) "]"; - font-weight: normal; - word-break: break-all; - } - } - h2, h3, hr { diff --git a/themes/v2/layouts/archive/single.html b/themes/v2/layouts/archive/single.html @@ -1,20 +1,26 @@ {{ define "main" }} - {{ $sd := .Params.start_date }} - {{ $ed := .Params.end_date }} + {{ $start_date := .Params.start_date }} + {{ $end_date := .Params.end_date }} - <section class="page-break"> - {{ time.Format "January 2006" $sd }} – {{ time.Format "January 2006" $ed }} - </section> + {{ $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" $sd) }} + {{ 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" $ed) }} + {{ 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> @@ -24,7 +30,31 @@ Posted {{ .Date | time.Format "2006-01-02" }} </h3> - {{ replaceRE `<audio controls src="((.*)/(.*).mp3)"></audio>` "<a href=\"$1\">$3</a>" .Content | safeHTML }} + {{ 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 }}