Skip to content

Commit

Permalink
[rss] single feed for /articles (#156)
Browse files Browse the repository at this point in the history
* [rss] single feed for /articles
* [rss] add feed icon
* [rss] footer
  • Loading branch information
fabi1cazenave authored Mar 20, 2024
1 parent e3c8dd2 commit afb6d09
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion www/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions www/content/articles/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "Articles"
outputs = ["html", "rss"]
footer = "[Flux RSS](index.xml)"
+++
9 changes: 5 additions & 4 deletions www/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 4 additions & 1 deletion www/layouts/_default/home.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{ define "main" }}
{{ .Content }}

<h2>Articles récents</h2>
<h2>Articles récents
<a href="articles/index.xml" title="flux RSS">
<img src="/rss.svg" alt="flux RSS" style="height: 1em;"></a>
</h2>

{{ range first 10 (where site.RegularPages "Section" "articles") }}
<article>
Expand Down
6 changes: 2 additions & 4 deletions www/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
<meta property="og:image:width" content="960">
<meta property="og:image:height" content="360">
<meta property="og:description" content="{{ .Site.Params.description }}">
<link type="image/svg+xml" rel="icon" href="{{ absURL "favicon.svg" }}" sizes="any">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
<link type="image/svg+xml" rel="icon" href="{{ absURL "favicon.svg" }}" sizes="any">
<link type="application/rss+xml" rel=alternate href="{{ absURL "articles/index.xml" }}" title="Ergo‑L">
{{ partial "head/js.html" . }}
{{ partial "head/css.html" . }}
13 changes: 13 additions & 0 deletions www/static/rss.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit afb6d09

Please sign in to comment.