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

feat(sitemap): allow customizing the output name #7469

Merged
merged 2 commits into from
May 27, 2022
Merged

Conversation

Josh-Cena
Copy link
Collaborator

@Josh-Cena Josh-Cena commented May 23, 2022

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

See https://docusaurus.canny.io/feature-requests/p/support-multi-instance-sitemaps-plugins

Since sitemap files can be manually uploaded/checked-in, the name is mostly irrelevant.

Test Plan

We don't have tests for this...

Test links

Deploy preview: https://deploy-preview-7469--docusaurus-2.netlify.app/docs/api/plugins/@docusaurus/plugin-sitemap/

Related issues/PRs

@Josh-Cena Josh-Cena added the pr: new feature This PR adds a new API or behavior. label May 23, 2022
@Josh-Cena Josh-Cena requested review from slorber and lex111 as code owners May 23, 2022 07:50
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 23, 2022
@netlify
Copy link

netlify bot commented May 23, 2022

[V2]

Name Link
🔨 Latest commit 5f5b992
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6290c787db924e00095b6f98
😎 Deploy Preview https://deploy-preview-7469--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented May 23, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 87 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟠 78 🟢 99 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link

github-actions bot commented May 23, 2022

Size Change: -95 B (0%)

Total Size: 796 kB

Filename Size Change
website/build/assets/js/main.********.js 598 kB -95 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.3 kB
website/build/assets/css/styles.********.css 106 kB
website/build/index.html 38.9 kB

compressed-size-action

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

🤷‍♂️ ok to add this, but I'm not sure to understand the use-case in practice

The docs state that "all Docusaurus content plugins can support multiple plugin instances". This support should extent to other plugins such as plugin-sitemap. For example, we want to weight docs differently in SEO based on their doc ID.

Yes but... all the sitemap plugins would receive the same routes, so unless you plan with the ignorePatterns you end up with the same result 🤷‍♂️

Now, about "weighting" some docIds, I don't know what the op means exactly

https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap#general-guidelines

Google ignores and values.

website/docs/api/plugins/plugin-sitemap.md Outdated Show resolved Hide resolved
@Josh-Cena Josh-Cena merged commit 7ab97d4 into main May 27, 2022
@Josh-Cena Josh-Cena deleted the jc/sitemap-name branch May 27, 2022 14:31
@dsmmcken
Copy link
Contributor

dsmmcken commented Jun 3, 2022

Yes but... all the sitemap plugins would receive the same routes, so unless you plan with the ignorePatterns you end up with the same result

Thanks for this. I actually have a use case.

I have a section of my site behind http-auth, and would like to exclude those pages from my sitemap that gets submitted to google for indexing. Google continually warns me it can't reach all those pages in the sitemap.

But I also need a full sitemap to pass to the algolia self hosted crawler to still index those pages (that crawls with http-auth).

I intended to publish two sitemaps, one for algolia indexing, one for google, this will make that easier.

@slorber
Copy link
Collaborator

slorber commented Jun 3, 2022

Thanks for clarifying, I wouldn't have been able to think of this use-case 🤪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants