From 49f08a13cd4a3992d6cc3d887376dcb89859bf99 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Sat, 4 Sep 2021 19:49:21 +0700 Subject: Update RSS for comics --- content/rss.md | 4 ++++ layouts/section/comics.rss.xml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 layouts/section/comics.rss.xml diff --git a/content/rss.md b/content/rss.md index 1302013..6ab1d13 100644 --- a/content/rss.md +++ b/content/rss.md @@ -42,3 +42,7 @@ feeds here: - [French](/fr/sus-perm/index.xml) - [German](/de/sus-perm/index.xml) - [Vietnamese](/vi/sus-perm/index.xml) + +## Comics + +- [English](/comics/index.xml) diff --git a/layouts/section/comics.rss.xml b/layouts/section/comics.rss.xml new file mode 100644 index 0000000..9b44c1c --- /dev/null +++ b/layouts/section/comics.rss.xml @@ -0,0 +1,41 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + + <img title="{{ .Params.TitleText }}" + alt={{ readFile (delimit (slice "/static/comics/" .Params.ComicId "/transcript.txt") "")}} + src="/comics/{{ .Params.ComicId }}/{{ .Params.ComicTitle }}.png" + srcset="/comics/{{ .Params.ComicId }}/{{ .Params.ComicTitle }}_full.png 2x" + > + See also:<br> {{ .Content | html }} + + + {{ end }} + + -- cgit 1.4.1