diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-05-24 06:18:10 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-05-24 06:18:10 +0200 |
| commit | af205845111a42b4ec5761918a9e6a3bfa1455f8 (patch) | |
| tree | 2d83499b81704e625b373f855c2a0741d63b3c75 | |
| parent | df1729b484b8ad74eae997f737d7c763ff843f3d (diff) | |
| download | mitjafelicijan.com-af205845111a42b4ec5761918a9e6a3bfa1455f8.tar.gz | |
Added RSS feed for notes only
| -rw-r--r-- | config.toml | 16 | ||||
| -rw-r--r-- | themes/simple/layouts/_default/notes.html | 9 | ||||
| -rw-r--r-- | themes/simple/layouts/partials/head.html | 1 | ||||
| -rw-r--r-- | themes/simple/layouts/section/notes.xml | 27 |
4 files changed, 51 insertions, 2 deletions
diff --git a/config.toml b/config.toml index 93fb8a0..02779c8 100644 --- a/config.toml +++ b/config.toml | |||
| @@ -39,3 +39,19 @@ enableRobotsTXT = true | |||
| 39 | 39 | ||
| 40 | [markup.highlight] | 40 | [markup.highlight] |
| 41 | style = 'github' | 41 | style = 'github' |
| 42 | |||
| 43 | # Taxonomies. | ||
| 44 | [outputs] | ||
| 45 | index = ["HTML", "atom"] | ||
| 46 | section = ["HTML", "notes"] | ||
| 47 | |||
| 48 | # Output formats. | ||
| 49 | [outputFormats] | ||
| 50 | [outputFormats.atom] | ||
| 51 | mediatype = "application/rss" | ||
| 52 | rel = "atom" | ||
| 53 | baseName = "atom" | ||
| 54 | [outputFormats.notes] | ||
| 55 | mediatype = "application/rss" | ||
| 56 | rel = "notes" | ||
| 57 | baseName = "notes" | ||
diff --git a/themes/simple/layouts/_default/notes.html b/themes/simple/layouts/_default/notes.html index b3a2f44..1685542 100644 --- a/themes/simple/layouts/_default/notes.html +++ b/themes/simple/layouts/_default/notes.html | |||
| @@ -2,8 +2,13 @@ | |||
| 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> | 2 | <main role="main" class="container-blog mx-auto px-6 md:p-0"> |
| 3 | 3 | ||
| 4 | <section class="mb-6"> | 4 | <section class="mb-6"> |
| 5 | <h1 class="text-2xl font-bold">Notes, notes and notes</h1> | 5 | <h1 class="text-2xl font-bold mb-2">Notes, notes and notes</h1> |
| 6 | <p class="text-gray-600 italic">Notes about things I learn, things I do, things I want to remember, but never do.</p> | 6 | <p class="text-gray-600 italic"> |
| 7 | Notes about things I learn, things I do, things I want to remember, | ||
| 8 | but never do. You can subscribe to this | ||
| 9 | <a href="/notes.xml" class="underline">RSS feed</a> | ||
| 10 | which contains only the notes without the blog posts. | ||
| 11 | </p> | ||
| 7 | </section> | 12 | </section> |
| 8 | 13 | ||
| 9 | <hr class="border-2 border-gray-100 mb-12"> | 14 | <hr class="border-2 border-gray-100 mb-12"> |
diff --git a/themes/simple/layouts/partials/head.html b/themes/simple/layouts/partials/head.html index 522c9a2..6d40525 100644 --- a/themes/simple/layouts/partials/head.html +++ b/themes/simple/layouts/partials/head.html | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | 6 | ||
| 7 | <link rel="alternate" type="application/rss+xml" href="/index.xml" title="{{ .Site.Author.name }}"> | 7 | <link rel="alternate" type="application/rss+xml" href="/index.xml" title="{{ .Site.Author.name }}"> |
| 8 | <link rel="alternate" type="application/rss+xml" href="/notes.xml" title="{{ .Site.Author.name }} - Notes"> | ||
| 8 | 9 | ||
| 9 | <link rel="stylesheet" href="/general/index.css?v={{ $cachebuster }}"> | 10 | <link rel="stylesheet" href="/general/index.css?v={{ $cachebuster }}"> |
| 10 | 11 | ||
diff --git a/themes/simple/layouts/section/notes.xml b/themes/simple/layouts/section/notes.xml new file mode 100644 index 0000000..7d4c52a --- /dev/null +++ b/themes/simple/layouts/section/notes.xml | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"> | ||
| 2 | |||
| 3 | <channel> | ||
| 4 | |||
| 5 | <title>{{ .Site.Author.name }} - Notes</title> | ||
| 6 | <link>{{ .Permalink }}</link> | ||
| 7 | <description>{{ .Site.Params.description }}</description> | ||
| 8 | <language>en-us</language> | ||
| 9 | |||
| 10 | {{ range (where .Site.RegularPages "Section" "notes") }} | ||
| 11 | <item> | ||
| 12 | |||
| 13 | <title>{{ .Title }}</title> | ||
| 14 | <link>{{ .Permalink }}</link> | ||
| 15 | <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> | ||
| 16 | {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} | ||
| 17 | <guid>{{ .Permalink }}</guid> | ||
| 18 | |||
| 19 | <description>{{ "<![CDATA[" | safeHTML }} {{ .Summary }}]]></description> | ||
| 20 | <content:encoded>{{ "<![CDATA[" | safeHTML }} {{ .Content }}]]></content:encoded> | ||
| 21 | |||
| 22 | </item> | ||
| 23 | {{end}} | ||
| 24 | |||
| 25 | </channel> | ||
| 26 | |||
| 27 | </rss> | ||
