Fix some art not being excluded from the feed

This commit is contained in:
Joshua Goins 2024-10-12 16:16:15 -04:00
parent 1150bee723
commit fce515b4e1
5 changed files with 23 additions and 7 deletions

View file

@ -22,7 +22,7 @@
{{ $dates = dict "date" (time.AsTime $data.date) }} {{ $dates = dict "date" (time.AsTime $data.date) }}
{{ else }} {{ else }}
{{ $dates = dict "date" (time.AsTime (printf "%s-01-01" $data.date)) }} {{ $dates = dict "date" (time.AsTime (printf "%s-01-01" $data.date)) }}
{{ $exclude_feed := true }} {{ $exclude_feed = true }}
{{ end }} {{ end }}
{{ $title := "Untitled Artwork" }} {{ $title := "Untitled Artwork" }}

View file

@ -1,5 +1,6 @@
{ {
"date": "2023-11-25", "date": "2023-11-25",
"program": "Krita", "program": "Krita",
"title": "three legs" "title": "three legs",
"nsfw": true
} }

View file

@ -1,5 +1,6 @@
{ {
"date": "2024-04-24", "date": "2024-04-24",
"program": "Krita", "program": "Krita",
"title": "Awkward" "title": "Awkward",
"nsfw": true
} }

View file

@ -9,5 +9,6 @@
"tags": [ "tags": [
"artfight" "artfight"
], ],
"title": "Farm-hands" "title": "Farm-hands",
"nsfw": true
} }

View file

@ -50,8 +50,9 @@
{{ range $pages }} {{ range $pages }}
{{ $isguest := (.Param "guest") }} {{ $isguest := (.Param "guest") }}
{{ $exclude := (.Param "excludefeed") }} {{ $exclude := (.Param "excludefeed") }}
{{ $isnsfw := (.Param "nsfw") }}
{{ if and (not $isguest) (not $exclude) }} {{ if and (and (not $isguest) (not $exclude)) (not $isnsfw) }}
<item> <item>
{{ with .Title }} {{ with .Title }}
<title>{{ . }}</title> <title>{{ . }}</title>
@ -76,8 +77,20 @@
{{ end }} {{ end }}
<content:encoded>{{ "<![CDATA[" | safeHTML }} <content:encoded>{{ "<![CDATA[" | safeHTML }}
{{ $pageScope := . }} {{/* Partial used to display a thumbnail of an artwork. */}}
{{ partial "render-art" . }}
{{ $full := printf "%s/thumb/%s.avif" $.Site.Params.image_host .Params.slug }}
{{ $jpeg := printf "%s/thumb/%s.jpg" $.Site.Params.image_host .Params.slug }}
<a aria-label="Gallery Item" class="no-decoration grid-item" href="{{ .RelPermalink }}">
{{ $title := .Title }}
{{ $year := .Date.Format "2006" }}
<picture>
<source srcset="{{ $full }}" type="image/avif" width="{{ $.Params.thumb_width }}" height="{{ $.Params.thumb_height }}"/>
<img style="width: 100%; height: auto;" alt="{{ $.Params.alt_text }}" title="{{ $title }} ({{ $year }})" width="{{ $.Params.thumb_width }}" height="{{ $.Params.thumb_height }}" src="{{ $jpeg }}"/>
</picture>
</a>
{{ with .Content }} {{ with .Content }}
<p>{{ . | safeHTML }}</p> <p>{{ . | safeHTML }}</p>