Skip to content

Commit

Permalink
Configure RSS for backwards compat
Browse files Browse the repository at this point in the history
Initial Atom setup is also there, but still needs the template.
  • Loading branch information
zeha committed Oct 3, 2024
1 parent c990b6f commit 0631ecd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 5 deletions.
31 changes: 29 additions & 2 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,32 @@ pagination:
taxonomies:
category: categories

disableKinds:
- term
mediaTypes:
"application/atom":
suffixes:
- "xml"
"application/rss+xml":
suffixes:
- "rss2"

outputFormats:
Atom:
mediaType: application/atom
baseName: "atom"
path: feeds/
isPlainText: false
Atom10:
mediaType: application/atom
baseName: "atom10"
path: feeds/
isPlainText: false
RSS:
mediaType: "application/rss+xml"
path: feeds/
noUgly: false

outputs:
home:
- HTML
- RSS
- Atom
22 changes: 19 additions & 3 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<meta name="Language" content="english">
<link rel="icon" href="/favicon.png" type="image/png">
{{ partialCached "head/css.html" . }}
{{ with .OutputFormats.Get "rss" -}}
{{ with .OutputFormats.Get "RSS" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
{{- end }}
</head>
<body>
<div class="container">
Expand All @@ -22,7 +22,23 @@
<main>
{{ block "main" . }}{{ end }}
</main>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
<nav>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
<h2>Archives</h2>
<ul>
<li><a href="{{ relref . "archive" }}">All posts</a></li>
</ul>

<h2>Subscribe</h2>
{{ with .OutputFormats.Get "RSS" -}}
<a href="{{ .Permalink | safeHTML }}"
onclick="(function(btn){var z=document.createElement('script');document.subtomeBtn=btn;z.src='https://www.subtome.com/load.js';document.body.appendChild(z);})(this); return false;"
value="Subscribe"
data-subtome-feeds="{{ .Permalink | safeHTML }}">
<img src="https://blog.grml.org/templates/2k11/img/subtome.png" alt="XML" style="border: 0px">
</a>
{{- end }}
</nav>
</div>
<footer>
{{ partial "footer.html" . }}
Expand Down

0 comments on commit 0631ecd

Please sign in to comment.