Browse Source

refactor(layout/default): remove nested conditional added in 258c747

pointer assignments return nil by design https://github.com/golang/go/issues/30349

closes #136
updates #135
Josh Habdas 9 months ago
parent
commit
852753f4fe
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      layouts/_default/rss.xml

+ 5
- 5
layouts/_default/rss.xml View File

@@ -3,12 +3,12 @@
3 3
     <docs>https://blogs.law.harvard.edu/tech/rss</docs>
4 4
     <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
5 5
     <link>{{ .Permalink }}</link>
6
-    <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>{{ if .Site.Params.images }}{{ if ge (len .Site.Params.images) 1 }}
6
+    <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>{{ range first 1 (default slice .Site.Params.images) }}
7 7
     <image>
8
-      <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
9
-      <link>{{ .Permalink }}</link>
10
-      <url>{{ index .Site.Params.images 0 }}</url>
11
-    </image>{{ end }}{{ end }}
8
+      <title>{{ if eq $.Title $.Site.Title }}{{ $.Site.Title }}{{ else }}{{ with $.Title }}{{ . }} on {{ end }}{{ $.Site.Title }}{{ end }}</title>
9
+      <link>{{ $.Permalink }}</link>
10
+      <url>{{ . }}</url>
11
+    </image>{{ end }}
12 12
     <ttl>1440</ttl>
13 13
     <generator>{{ with .Site.Data.npm.latest }}{{ .name | humanize | title }} {{ .version }} (Hugo {{ $.Hugo.Version }}){{ else }}Hugo {{ .Hugo.Version }}{{ end }}</generator>{{ with .Site.LanguageCode }}
14 14
     <language>{{ . }}</language>{{ end }}{{ with .Site.Author }}

Loading…
Cancel
Save