From ef86710c08eed1e8db44ef0ff5ff9ed322644918 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 10 May 2018 13:49:32 +0100 Subject: [PATCH] Add atom feed Because RSS is _soo_ 2017 --- config.yml | 10 +++++++++ layouts/_default/list.atom | 39 +++++++++++++++++++++++++++++++++ layouts/partials/copyright.html | 1 + layouts/partials/footer.html | 4 +--- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 layouts/_default/list.atom create mode 100644 layouts/partials/copyright.html diff --git a/config.yml b/config.yml index 16fa0b4..06cd1fc 100644 --- a/config.yml +++ b/config.yml @@ -11,19 +11,29 @@ params: summaryLength: 40 + +mediaTypes: + "application/atom": + suffix: atom outputFormats: markdown: name: "txt" mediaType: "text/plain" isPlainText: true + atom: + name: "atom" + mediaType: "application/atom" + isPlainText: false outputs: home: - "html" - "rss" + - "atom" - "json" section: - "html" - "rss" + - "atom" - "txt" page: - "html" diff --git a/layouts/_default/list.atom b/layouts/_default/list.atom new file mode 100644 index 0000000..986e255 --- /dev/null +++ b/layouts/_default/list.atom @@ -0,0 +1,39 @@ + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + A subtitle. + + + {{ .Permalink }} + {{ now.Format .Site.Params.iso8601 }} + {{ absURL "/img/logo-transparent.png" }} + {{ absURL "/img/logo-transparent.png" }} + + {{ .Site.Params.author }} + {{ absURL "/" }} + + + {{ partial "copyright.html" . | html }} + + + {{ range .Data.Pages }} + + {{ .Title }} + + {{ .Permalink }} + {{ .Date.Format .Site.Params.iso8601 }} + {{ .Date.Format .Site.Params.iso8601 }} + + {{ partial "copyright.html" . | html }} + + {{ .Summary }} + + {{ .Content | html }} + + + {{ .Site.Params.author }} + {{ absURL "/" }} + + + {{ end }} + diff --git a/layouts/partials/copyright.html b/layouts/partials/copyright.html new file mode 100644 index 0000000..12d533e --- /dev/null +++ b/layouts/partials/copyright.html @@ -0,0 +1 @@ +© {{ now.Year }} {{ .Site.Title }}. diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 156b2e1..7de31a7 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -2,9 +2,7 @@
-

- © {{ now.Year }} {{ .Site.Title }}. -

+

{{ partial "copyright.html" . }}