Skip to content

Advertise Atom/RSS feeds from the HTML head - #718

Open
agriyakhetarpal wants to merge 4 commits into
scientific-python:mainfrom
agriyakhetarpal:atom-feed-discovery
Open

agriyakhetarpal wants to merge 4 commits into
scientific-python:mainfrom
agriyakhetarpal:atom-feed-discovery

Conversation

@agriyakhetarpal

Copy link
Copy Markdown
Member

This PR changes our layout to emit <link rel="alternate"> tags for every alternative output format of the current page, plus the home page's formats on all other pages. This lets feed readers autodiscover the Atom feed from any page on a site that uses our theme.

This is a bug in my view, since https://github.com/FAST-HEP/hugo-atom-layout does this via its own partials/head.html, but our partial took precedence and shadowed that partial.

Note that those websites that don't disable RSS will now also advertise Hugo's default index.xml.

@agriyakhetarpal agriyakhetarpal added the type: Bug fix Something isn't working label Sep 11, 2026
@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for scientific-python-hugo-theme ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5a824d1
🔍 Latest deploy log https://app.netlify.com/projects/scientific-python-hugo-theme/deploys/6aa4787db7a7540008ae40ff
😎 Deploy Preview https://deploy-preview-718--scientific-python-hugo-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94
Accessibility: 97
Best Practices: 100
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ $.Site.Title }}">
{{ end -}}
{{ if not .IsHome -}}
{{ range site.Home.AlternativeOutputFormats -}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we may see some duplication here if both the page and site settings provide alternatives?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can do something like having the page-level link having the page title, and the site-wide link having the site title. I guess that would work?

See 037aa3d

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also do a join, like site name — page name or similar.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right; good idea. Sphinx also does that. Let's do it. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agriyakhetarpal and others added 2 commits September 12, 2026 03:23
Co-Authored-By: Stefan van der Walt <45071+stefanv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Bug fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants