I have been looking for a way to make this work also…
my logic would suggest your standard code…
{{ if .RSSLink }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" />
{{ end }}
is at fault as it is only looking for the link name which is set by default in config to index.xml - so therefore… there is a link name set in config and your <link… will be generated and throw a 404 as you have RSS turned off in disableKinds
I noticed the same behaviour today. It might not be a bug (as in, programming error), but we can probably implement this better. Because as you already point out, if disableKinds disables the RSS feeds, it would make more sense if .RSSLink returns false or null so that the conditional if statement doesn’t execute.
That way the template code that the documentation suggests to include the RSS feed actually points to a RSS feed (and doesn’t give 404 errors).
I also couldn’t get access to the current disableKinds setting as a work around.
@Jura I’m having the same problem. Did you find a workaround?
Maybe we should fill an issue. IMO .RSSLink should be false/empty when RSS is disabled. If this isn’t an option (maybe there is a use case I’m not seeing), at least there should be a way to check if RSS is enabled.
I’ll definitely try to fix the docs where I can, there’s a lot of confusing stuff out there
I’m not sure what you meant with this. Hugo is outputting <link rel="alternate" type="application/rss" href="[url]"> but the correct type seems to be "application/rss+xml" (even though the applications handle lots of non standard types for rss). Please let me know if I am missing something here.
Summing up for other readers (specifically @Jura):
RSS “kind” will be removed (so disableKinds = ["RSS"] alone to disable RSS won’t work anymore).
Sorry if this is obvious, I’m not a web developer. You said that the mime type should be "application/rss" but the correct one seems to be "application/rss+xml" (other sources: https://developer.mozilla.org/en-US/docs/Archive/RSS/Getting_Started/Syndicating, RSS - Wikipedia, etc.). So naturally I’m not sure if you are referring to something I don’t know, or if you are not correct about the mime type. That’s why I din’t find your statement clear.
The thing about mimetypes is, that they are recommendations, not the law. They basically tell the “consuming party” what can be expected as the content and formatting of the file they are receiving so they can display them right. “consuming party” being browsers and rss readers.
application/rss+xml might be the “official” solution the RSS board expects. application/rss does not really exist out there
but
application/xml is the most compatible solution. Because RSS as such is an XML format and the resulting XML has information in the starting tag what specifications to use for special tags:
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> - the xmlns:atom would give the browser all the hints, what the meaning of atom-tags are, like: <atom:link href="some link" rel="self" type="application/rss+xml"/>. Even if this information would not be available the consumer could parse the tag and use it as textual information.
I think the main issue in implementing this might be, that Hugo seems to push through the “Hugo mimetype” as “application/HugoMimetype” where it should have some kind of mapping what mimetype-extension to print.
But this is just IMHO. I would be solving the original issue up top with a own parameter in my config that gets checked.
I know this is a feature of software that isn’t in version 1.0 yet, but can you share which other Hugo features are scheduled to be removed or have their meaning change?
That’s good to know for the community so we don’t have people blog about stuff that gets removed. Or use features in their theme that error seen, adding to more confusion.