Merge pull request #6 from recanman/main

fix: check existence of goal as it is never zero, fix: exclude "Weeklies" entry in RSS feed
This commit is contained in:
rottenwheel 2024-07-05 12:27:21 -05:00 committed by GitHub
commit 2998f1d9bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 10 deletions

View file

@ -12,16 +12,18 @@
<atom:link href="{{ .Permalink }}" rel="self" type="application/rss+xml" />
{{ range where .Site.Pages "Type" "weekly" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<guid isPermaLink="true">{{ .Permalink }}</guid>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
{{ if ne .Title "Weeklies" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<guid isPermaLink="true">{{ .Permalink }}</guid>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
<content type="html">{{ .Content | truncate 350 | html }}</content>
<media:thumbnail url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
<media:content medium="image" url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
</item>
<content type="html">{{ .Content | truncate 350 | html }}</content>
<media:thumbnail url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
<media:content medium="image" url="{{ .Permalink }}cover.png" xmlns:media="http://search.yahoo.com/mrss/" />
</item>
{{ end }}
{{ end }}
</channel>
</rss>

View file

@ -7,7 +7,7 @@
{{ $goal := .Get "goal" }}
{{ $raised := .Get "raised" }}
{{ with .Get "raised" }}
{{ with $goal }}
<p>Raised <b>{{ $raised }}</b> of <b>{{ $goal }}</b> XMR ({{ div (.) ($goal) | mul 100 | int }}%)</p>
{{ end }}
</div>