fix: footer rss and hugo deprecations #2
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/footer-rss-and-deprecations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The footer used $ (the partial's context, i.e. the current page) to look up the RSS output format, so the link depended on which page was being rendered. Any page without an RSS output emitted href="", which browsers resolve to the current URL — on /search/ the RSS icon therefore linked back to /search/. Most pages have no RSS output: only home, section and taxonomy pages do, by Hugo's default output configuration. The link was therefore broken on every single page, every term page, and about/contact/search. Resolve the feed from site.Home once, at the top of the partial, and skip the link entirely when the site has no feed, so an empty href can never be rendered again. The footer is site-wide, so its feed link should be too. Also replace two accessors Hugo has deprecated: - site.Language.LanguageCode -> site.Language.Locale (0.158) - .IsNode -> .IsBranch in breadcrumbs (0.163) .Language.Locale is a drop-in replacement: it returns the same value and still honours the deprecated `languageCode` config key, so existing sites keep working. Unlike .Language.Lang it preserves a region ("en-GB"), which is what og:locale and JSON-LD inLanguage want. This raises the minimum supported Hugo to 0.163.0, documented in the README. Finally, point the README's example site at the renamed news repository. Verified against the news site: all 43 rendered pages now link to /index.xml, and the markup is otherwise byte-identical to v0.1.0.