Skip to content

Commit

Permalink
Merge pull request #10 from imfing/imfing/fin-16-add-full-text-conten…
Browse files Browse the repository at this point in the history
…t-in-rss-feed
  • Loading branch information
imfing committed Dec 5, 2022
2 parents c4a3a55 + 83016b0 commit c0fca70
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ While storing and editing Markdown files in a GitHub repository is typical for b
- more user-friendly interface with built-in labelling and search 🔍
- accessible from mobile app and website, good for capturing thoughts 📱
- streamlined workflow by leveraging [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/quickstart-for-projects) and Issue status (open/closed)
- free GitHub CDN for displaying images and videos
1 change: 1 addition & 0 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defaultContentLanguage = "en"
enableRobotsTXT = true
paginate = 10
summaryLength = 0
rssLimit = 20

[outputs]
home = ["HTML", "RSS", "JSON"]
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Effortlessly write and publish on GitHub

Use GitHub Issues to capture thoughts and manage contents, publish as a website automatically.

<sup>Content generated from [Issues · imfing/issues-blog](https://github.com/imfing/issues-blog/issues?q=is:issue+is:closed).</sup>
<sup>[RSS Feed](./index.xml). Content generated from [Issues · imfing/issues-blog](https://github.com/imfing/issues-blog/issues?q=is:issue+is:closed).</sup>
39 changes: 39 additions & 0 deletions layouts/index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

0 comments on commit c0fca70

Please sign in to comment.