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

Is my sitemap working? #12954

Closed
1 task
dreamstar-enterprises opened this issue Jan 9, 2025 · 2 comments
Closed
1 task

Is my sitemap working? #12954

dreamstar-enterprises opened this issue Jan 9, 2025 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@dreamstar-enterprises
Copy link

dreamstar-enterprises commented Jan 9, 2025

Astro Info

5.1.1.

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

No response

Describe the Bug

I have these site map settings, after reading the astro docs.

integrations: [
    tailwind({
      // Disable injecting a basic `base.css` import on every page.
      // Use tailwind css styles with custom layers instead
      applyBaseStyles: false,
      // Prevent writing nested CSS declarations
      nesting: false,
    }),
    mdx(),
    markdoc(),
    sitemap({
      filter: (page) =>
        page !== "https://stargazers.club/secret-vip-lounge-1/" &&
        page !== "https://stargazers.club/secret-vip-lounge-2/" &&
        page !== "https://stargazers.club/secret-vip-lounge-3/" &&
        page !== "https://stargazers.club/secret-vip-lounge-4/",
      i18n: {
        defaultLocale: i18nConfig.defaultLocale,
        locales: sitemapLocales,
      },
    }),
  ],

I also have this astro header component:

<!-- SEO and site navigation -->
<link rel="icon" type="image/svg+xml" href={import.meta.env.BASE_URL + '/favicon.svg'} />
<link rel="sitemap" href={import.meta.env.BASE_URL + '/sitemap-index.xml'} />

There is no sitemap when I run npm run dev.

When I do npm run build and then npm run preview, I see two files in the dist folder.

  • sitemap-0.xml
  • sitemap-index.xml

Then when I go to:

http://localhost:4321/base/sitemap-index.xml

All I see is in the browser, is:

<sitemapindex>
<sitemap>
<loc>
https://www.mysite.com/base/sitemap-0.xml
</loc>
</sitemap>
</sitemapindex>

http://localhost:4321/base/sitemap-0.xml gives

https://www.mysite.com/base/auth/error/https://www.mysite.com/base/en-gb/https://www.mysite.com/base/en-gb/auth/error/

Am I doing things right? sitemap-0 does show all the pages on my site currently. Am I meant to be using the sitemap-0.xml or something else in a different way?

It's not clear on the documenation.

What's the expected result?

Is my implementation of sitemap correct?

Am I not meant to see a page showing all my site links?

Link to Minimal Reproducible Example

seeabove

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 9, 2025
@florian-lefebvre
Copy link
Member

Hi! Issues are for bugs, not for support. Discord is a better place for this kind of things. But to answer your question, everything is explained at https://docs.astro.build/en/guides/integrations-guide/sitemap/. The file you should link is the one that ends with index.xml

@florian-lefebvre florian-lefebvre closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@dreamstar-enterprises
Copy link
Author

Hi Florian,
sorry. Thanks for the link, I will read through it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants