From 3cbda6ee1db9cbfce6fa186d8ceb2b351961267c Mon Sep 17 00:00:00 2001 From: bamboo Date: Mon, 12 Feb 2024 14:58:36 +0800 Subject: [PATCH] :sparkles: Feat: update rss template --- hugo.yaml | 10 +++++++++- themes/PaperMod/layouts/_default/rss.xml | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hugo.yaml b/hugo.yaml index 8a05348..3c5a3cb 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -26,12 +26,18 @@ taxonomies: # not using tags +services: + rss: + limit: 20 + params: env: production # to enable google analytics, opengraph, twitter-cards and schema. title: "Blah Blah Booooom" description: "Personal Blog of Bamboo/Zhuzi/竹子" keywords: [Blog] - # author: Me + author: + name: bambooom + email: zhuzi.mn#gmail.com # author: ["Me", "You"] # multiple authors images: [""] DateFormat: "January 2, 2006" @@ -46,12 +52,14 @@ params: ShowCodeCopyButtons: false ShowWordCount: false ShowRssButtonInSectionTermList: true + ShowFullTextinRSS: true UseHugoToc: true disableSpecial1stPost: false disableScrollToTop: false comments: true hidemeta: false hideSummary: true + hideAuthor: true showtoc: false tocopen: false diff --git a/themes/PaperMod/layouts/_default/rss.xml b/themes/PaperMod/layouts/_default/rss.xml index b6a7ec0..af00ca5 100644 --- a/themes/PaperMod/layouts/_default/rss.xml +++ b/themes/PaperMod/layouts/_default/rss.xml @@ -42,12 +42,12 @@ {{- if ge $limit 1 }} {{- $pages = $pages | first $limit }} {{- end }} -{{- printf "" | safeHTML }} +{{- printf "" | safeHTML }} {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }} {{ .Permalink }} - Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} + {{ or .Description site.Params.Description }} {{- with site.Params.images }} {{ site.Title }} @@ -65,7 +65,7 @@ {{ printf "" .Permalink .MediaType | safeHTML }} {{- end }} {{- range $pages }} - {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} + {{- if and (ne .Layout `search`) (ne .Layout `archives`) (ne .Layout `about`) }} {{ .Title }} {{ .Permalink }} @@ -74,7 +74,7 @@ {{ .Permalink }} {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} {{- if site.Params.ShowFullTextinRSS }} - {{ (printf "" .Content) | safeHTML }} + {{ printf "" .Content }} {{- end }} {{- end }}