Skip to content

Commit

Permalink
fix rss feed on hugo export
Browse files Browse the repository at this point in the history
closes #66
  • Loading branch information
ratsclub committed Jul 17, 2024
1 parent 8c7e207 commit a33c9c8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion export_base_hugo/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
{{- end }}

<link href="{{ .Site.BaseURL }}style.css" rel="stylesheet">
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml">
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }}
</head>

<body>
Expand Down
5 changes: 5 additions & 0 deletions export_base_hugo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ theme = "mataroa"

[params]
description = "Example blog description"

[outputFormats]
[outputFormats.RSS]
mediatype = "application/rss"
baseName = "rss"
8 changes: 6 additions & 2 deletions export_base_hugo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ <h1>{{ .Site.Title }}</h1>
</main>

<footer>
--
<br><a href="/rss.xml">RSS</a>
{{ with .OutputFormats.Get "rss" -}}
<p>
Subscribe via
{{ printf `<a href=%q title=%q>RSS</a>` .Permalink site.Title | safeHTML }}
</p>
{{ end }}
</footer>
{{ end }}
9 changes: 8 additions & 1 deletion export_base_hugo/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ <h1 class="posts-item-title" itemprop="name headline">
</article>
</main>
<footer>
<a href="/">← archive</a>
{{- with .Site.GetPage "/" }}
{{- with .OutputFormats.Get "rss" }}
<p>
Subscribe via
{{ printf `<a href=%q title=%q>RSS</a>` .Permalink site.Title | safeHTML }}
</p>
{{- end }}
{{- end }}
</footer>
{{ end }}

0 comments on commit a33c9c8

Please sign in to comment.