Table of Contents links in RSS feed don't include slug

New to Hugo. Have just ported a site from Jekyll and am extremely pleased so far.

Have looked through the docs but am somewhat confused as to how to address an issue I’m having with the generated RSS feed. The Table of Contents entries in the feed do not include the slug. For example:

On the single post, a table of contents entry link:
https://www.lutheranlibrary.org/192-long-great-gospel/#be-something-and-stand-for-it

On the RSS feed:
https://www.lutheranlibrary.org/#be-something-and-stand-for-it

The permalinks are defined in config.toml:

[permalinks]
  post = "/:slug/"

The site repository is here.

This is using the “Academic” theme.

Thank you for any help with this. :+1:

I checked your feed and see the URLs you expect:

<item><title>The Great Gospel by Simon Peter Long</title><link>https://www.lutheranlibrary.org/192-long-great-gospel/</link><pubDate>Fri, 14 Dec 2018 12:00:00 +0000</pubDate><guid>https://www.lutheranlibrary.org/192-long-great-gospel/</guid>

Did you figure it out? :slight_smile:

Hi @maiki,

That is really strange! When I look at the feed through firefox, the link above is still https://www.lutheranlibrary.org/#be-something-and-stand-for-it

It’s also the same when viewed through the quiterss application.

Where are you seeing the feed as correct?

https://www.lutheranlibrary.org/feed.xml

Where are you seeing it incorrect? :slight_smile: I got to that URL from reading your config file.

Hi Maiki,

When I look at the page source for https://www.lutheranlibrary.org/feed.xml as retrieved in firefox, the following excerpt shows the table of contents links to be incorrect, as they do not include the “slug” for the page. Instead, they just show the base URL and the #index location. Below is the exact html which is delivered:

<h2>Table of Contents</h2>
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#be-something-and-stand-for-it">Be Something and Stand For It</a></li>
<li><a href="#the-scripture-twisters">The Scripture-twisters</a></li>
<li><a href="#contents">Contents</a></li>
<li><a href="#that-holy-book-divine-by-simon-peter-long">That Holy Book Divine by Simon Peter Long</a></li>
<li><a href="#download-the-ebook-i-class-fas-fa-arrow-circle-down-i-download">Download the eBook <a href="#download"><i class="fas fa-arrow-circle-down"></i></a></a></li>
</ul></li>
</ul>
</nav>

Oh, okay. I didn’t understand that before.

I think you are fine. RSS isn’t read online, it is read “offline”, and generates a document tree where that works. I’m pretty sure you don’t need to mind that, but check it out yourself: subscribe to it in an RSS reader, and see how those links work. Some of them will, some of them won’t because the client (feed reader) will strip out headers, so the TOC is useless in those scenarios.

It’s weird, but just keep in mind the purpose of RSS. Those relative links probably work fine. But I do encourage testing. :slight_smile:

Just tested them in another RSS reader. In both cases the TOC links in feed point back to the front page of the site, at the anchor point which should be to the post page. Not as desired, though I don’t know how to fix.

Appreciate your willingness to help though, @maiki. Perhaps someone else will have some ideas at some point. :slight_smile: