From afb6d090efbd35fda67c213858af50a1c5e84498 Mon Sep 17 00:00:00 2001 From: Fabien Cazenave Date: Wed, 20 Mar 2024 21:44:28 +0100 Subject: [PATCH] [rss] single feed for /articles (#156) * [rss] single feed for /articles * [rss] add feed icon * [rss] footer --- www/content/_index.md | 2 +- www/content/articles/_index.md | 5 +++++ www/hugo.toml | 9 +++++---- www/layouts/_default/home.html | 5 ++++- www/layouts/partials/head.html | 6 ++---- www/static/rss.svg | 13 +++++++++++++ 6 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 www/content/articles/_index.md create mode 100644 www/static/rss.svg diff --git a/www/content/_index.md b/www/content/_index.md index 863fbc30..948f3bcd 100644 --- a/www/content/_index.md +++ b/www/content/_index.md @@ -3,7 +3,7 @@ cssSheets = ["/css/keebs.css"] jsModules = ["/js/x-keyboard.js"] jsScripts = ["/js/keebs.js"] -footer = "propulsé par [x-keyboard](https://onedeadkey.github.io/x-keyboard)" +footer = "[Flux RSS](/articles/index.xml)" +++ Ergonomique avant tout. diff --git a/www/content/articles/_index.md b/www/content/articles/_index.md new file mode 100644 index 00000000..66cd7649 --- /dev/null +++ b/www/content/articles/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Articles" +outputs = ["html", "rss"] +footer = "[Flux RSS](index.xml)" ++++ diff --git a/www/hugo.toml b/www/hugo.toml index d1dc5d0b..2c8bcc38 100644 --- a/www/hugo.toml +++ b/www/hugo.toml @@ -82,8 +82,9 @@ author = "authors" # pageRef = "/articles" # weight = 6 +# Disable RSS everywhere, and enable it manually in /content/articles/_index.md [outputs] - home = ['html'] - section = ['html', 'rss'] - taxonomy = ['html'] - term = ['html'] + home = ["html"] + section = ["html"] + taxonomy = ["html"] + term = ["html"] diff --git a/www/layouts/_default/home.html b/www/layouts/_default/home.html index 13a42ee2..b246f561 100644 --- a/www/layouts/_default/home.html +++ b/www/layouts/_default/home.html @@ -1,7 +1,10 @@ {{ define "main" }} {{ .Content }} -

Articles récents

+

Articles récents + + flux RSS +

{{ range first 10 (where site.RegularPages "Section" "articles") }}
diff --git a/www/layouts/partials/head.html b/www/layouts/partials/head.html index 4bd15557..7b5feb79 100644 --- a/www/layouts/partials/head.html +++ b/www/layouts/partials/head.html @@ -12,9 +12,7 @@ - -{{ with .OutputFormats.Get "rss" -}} - {{ printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} -{{ end }} + + {{ partial "head/js.html" . }} {{ partial "head/css.html" . }} diff --git a/www/static/rss.svg b/www/static/rss.svg new file mode 100644 index 00000000..b7fb87ba --- /dev/null +++ b/www/static/rss.svg @@ -0,0 +1,13 @@ + + + + + + +