From 749435298ec5e89926e0e9a3a19694a2f5d6e755 Mon Sep 17 00:00:00 2001 From: David Eisinger Date: Fri, 10 Jan 2025 22:35:09 -0500 Subject: [PATCH] List references at end of archive --- themes/v2/assets/css/style.scss | 13 -------- themes/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 index e0a2016..0216241 100644 --- 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 index c5d3b63..e5ccf6c 100644 --- 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 }} -
- {{ time.Format "January 2006" $sd }} – {{ time.Format "January 2006" $ed }} -
+ {{ $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 }} + +
+ Dispatches, {{ time.Format "January 2006" $start_date }} – {{ time.Format "January 2006" $end_date }} +
+ + {{ range $dispatches }}

{{ .Title }} @@ -24,7 +30,31 @@ Posted {{ .Date | time.Format "2006-01-02" }}

- {{ replaceRE `` "$3" .Content | safeHTML }} + {{ replaceRE `` "$3 ($1)" .Content | safeHTML }}
{{ end }} + + {{ $linkRE := `(?s)]+?href="(.+?)"[^>]*?>.*?` }} + +

References

+ + {{ range $dispatches }} +

{{ .Title }}

+ +
    +
  1. {{ .RelPermalink }}
  2. + + {{ range findRE $linkRE .Content }} + {{ if findRE ` + {{ end }} +
+ {{ end }} {{ end }}