Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the "Astro Starter Kit: Blog", BaseHead contains no rel links to the sitemap or RSS feed #13041

Closed
1 task done
ttmc opened this issue Jan 22, 2025 · 4 comments · Fixed by #13043
Closed
1 task done
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: example Related to an example package (scope)

Comments

@ttmc
Copy link
Contributor

ttmc commented Jan 22, 2025

Astro Info

Astro                    v5.1.5
Node                     v22.11.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Today, you can generate a new blog using the "Astro Starter Kit: Blog", i.e. npm create astro@latest -- --template blog. If you do that, the generated site has a sitemap file at /sitemap-index.xml and an RSS feed file at /rss.xml, but there are no rel links to those files in the <head> tag.

What's the expected result?

The <head> tag defined in BaseHead.astro, should contain rel links to the sitemap file and the RSS feed file of the form:

<link rel="sitemap" href="/sitemap-index.xml" />
<link rel="alternate" type="application/rss+xml" title={SITE_TITLE} href={new URL("rss.xml", Astro.site)} />

The rel link for the sitemap file is from the documentation for @astrojs/sitemap.

The rel link for the RSS feed file is based on the documentation for @astrojs/rss. One should use SITE_TITLE rather than title because the RSS feed is for the whole site.

To fix this bug, all one would need to do is add those two links to the <head> tag in BaseHead.astro, along with one more line in the frontmatter section at the top of BaseHead.astro:

import { SITE_TITLE } from '../consts';

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog?file=src%2Fcomponents%2FBaseHead.astro&view=editor

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jan 22, 2025
@florian-lefebvre
Copy link
Member

Sounds good to me! Wanna submit a PR?

@florian-lefebvre florian-lefebvre added - P2: nice to have Not breaking anything but nice to have (priority) and removed needs triage Issue needs to be triaged labels Jan 22, 2025
@ttmc
Copy link
Contributor Author

ttmc commented Jan 22, 2025

I'm afraid that the instructions in https://github.com/withastro/astro/blob/main/CONTRIBUTING.md are too much for me. Would it be okay if I just did something simple like what's outlined in https://github.com/firstcontributions/first-contributions ?

@ascorbic
Copy link
Contributor

Yes, most of our intructions are only relevant when you're needing to compile the Astro code. This is just an example, so it's fine to just open a PR with those insteructions. You can even edit it in the GitHub interface when it's very simple.

@ascorbic ascorbic added the pkg: example Related to an example package (scope) label Jan 22, 2025
@ttmc
Copy link
Contributor Author

ttmc commented Jan 22, 2025

I submitted a PR to fix this issue: #13043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants