Closed whatacold closed 3 years ago
Still not working after trying:
hugo v0.87.0-B0C541E4+extended
It looks like {{ with .OutputFormats.Get "RSS" }}
is false for blog post, but I can't figure out why:(
I don't get it, maybe I simply don't show it on post pages, by hacking that part of layouts/partials/footer.html
to as follows:
{{ if .Site.Params.rss }}
{{ with .OutputFormats.Get "RSS" }}
<li>
<a href="{{ .RelPermalink }}" title="RSS">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{{ end }}
{{ end }}
Give a try to
{{ if .Site.Params.rss }}
<li>
<a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" title="RSS">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{{ end }}
See also https://framagit.org/roneo/roneo.frama.io/-/blob/master/layouts/_default/rss.xml and https://github.com/halogenica/beautifulhugo/issues/330
Woops, this is a duplicate of #330 .
Give a try to Seems like this snippet is what it was before I worked-around it.
My understanding is that hugo doesn't assign {{ with .OutputFormats.Get "RSS" }}
internally, so there is nothing beautifulhugo can do here. But I don't have the energy to investigate it further on the hugo code base.
BTW, which hugo version do you use?
BTW, which hugo version do you use?
I'm using hugo_extended:0.80.0
on roneo.org.
Hint: you can check which version is used by a project in his gitlab-ci.yml
For example: https://framagit.org/roneo/roneo.frama.io/-/blob/master/.gitlab-ci.yml#L1
Thanks for the pointer, I also use this version.
I'm going to build your sites and see how it works, if I have the time.
Hi @whatacold, could you please close this issue and re-open if you have time to make a test and face a problem? (let's try to keep this bug tracker not-too-scary 😅 !)
OK, the workaround I took was not to show RSS on posts.
I've fixed this. The issue is that the page
type doesn't have an RSS feed output, and it wouldn't make sense to - it'd only show updates for that page. This also brings up that the RSS button in different sections shows a specific RSS link for that section, that only has posts for that section.
A clearer model is to simply use the same single site (home page) RSS link for all, assuming you show posts on your front page.
In <beautifulhugo>/layouts/partials/footer.html
, change
<a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" title="RSS">
to
<a href="{{ printf "%s%s" site.BaseURL "index.xml"}}" title="RSS">
If you want a fixed version of the previous functionality, where it uses the page's (section's) RSS feed if it exists, otherwise falls back to the main site one, change it to:
<a href="
{{ if (.OutputFormats.Get "RSS") }}
{{ (.OutputFormats.Get "RSS").RelPermalink }}
{{ else }}
{{ printf "%s%s" site.BaseURL "index.xml"}}
{{ end }}
" title="RSS">
The RSS href in posts are empty with html:
For comparison,
rss.xml
But it's okay on the homepage and section pages.