1bl4z3r / hermit-V2

Continuing Hermit's legacy to be minimal and fast theme
https://1bl4z3r.github.io/hermit-V2/
MIT License
91 stars 38 forks source link

[BUG] If RSS is disabled (Add "RSS" to disableKinds), the footer RSS icon is still visible and leads to a 404 page #58

Closed xuhdev closed 6 months ago

xuhdev commented 6 months ago

Describe the bug After disabling RSS in hugo.toml via disableKinds = ["RSS"], the footer RSS icon is still visible, and it links to a 404 page.

To Reproduce Steps to reproduce the behavior:

  1. Add disableKinds = ["RSS"] to hugo.toml.
  2. Build the site.
  3. Note that the RSS icon is visible and clicking on it leads to a 404 page.

Expected behavior RSS icon should become invisible.

Hugo (please complete the following information):

xuhdev commented 6 months ago

I started a thread on hugo forum, which may be helpful.

1bl4z3r commented 6 months ago

Hi @xuhdev,

I never had the insight that someone would like to disable RSS. I will take a look at it

1bl4z3r commented 6 months ago

Funny thing is there is already a provision to use disableKinds for RSS and it just so happens that my smartass decided to comment it out for no apparent reason and forgotten about it... XD

https://github.com/1bl4z3r/hermit-V2/blob/5ebeb52132413cc6b4afc70a010aa9747abeb709/layouts/partials/footer.html

{{/*{{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }}*/}}
&#183; <a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss">{{ partial "svg.html" (dict "context" . "name" "rss") }}</a>
{{/*{{ end }}*/}}
xuhdev commented 6 months ago

I tried to uncomment them directly, but it doesn't work...

1bl4z3r commented 6 months ago

Yep, I did the same. Looks like .Site.Language.Get is either depreciated or is not working as intended.

I will try to smash my head onto this and hopefully come out with a working stuff

1bl4z3r commented 6 months ago

Just got a revelation... And My reaction was WTF!?

https://discourse.gohugo.io/t/disablekinds-and-rsslink-not-playing-together/7313/13

From Our Man Himself (bep)

RSS is not a kind (or it is, but that is for internal use and will be removed soon). To disable RSS you need to define output formats…
1bl4z3r commented 6 months ago

Hi @xuhdev,

Sorry for earlier post. I just saw your hugo forum thread and realized you're asking of the same thing.

I have pushed a temporary fix. Please test it out let me know if RSS is being generated or not. You have to put below in hugo.toml

[outputs]
  home = ['html']
  page = ['html']
  section = ['html']
  taxonomy = ['html']
  term = ['html']

Keeping this Issue opened for a week. Hoping to get a response from you

xuhdev commented 6 months ago

Yes, it addressed the issue! Thanks!!