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: add sitemap index file #235

Merged
merged 2 commits into from
Jun 21, 2022
Merged

feat: add sitemap index file #235

merged 2 commits into from
Jun 21, 2022

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Jun 20, 2022

Fixes #232

This PR:

  • Fixes URLs in <loc> tags of the sitemap to be absolute as required by https://sitemaps.org/protocol.html.
  • Fixes code that generates <changefreq> in the sitemap. It was always empty (<changefreq></changefreq>), which is technically invalid against https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
  • Adds sitemap-index.xml file in the root. It will contain references to https://eslint.org/sitemap.xml and https://eslint.org/docs/latest/sitemap.xml. On translation sites, it will contain only one reference, e.g, https://es.eslint.org/sitemap.xml.
  • Updates robots.txt to point to sitemap-index.xml instead of sitemap.xml.
  • Also removes blank line between User-agent and Disallow, as blank lines are delimiters.
  • Disables generating sitemaps on translation sites (see the comment in .eleventy.js).
  • Adds multilingual: true to pages that appear on translation sites and filters the sitemaps for translation sites by this property.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for new-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/62b1dcd0ea2b210008dfd059
😎 Deploy Preview https://deploy-preview-235--new-eslint.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.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/es-eslint/deploys/62b1dcd03d1c6300081e18a7
😎 Deploy Preview https://deploy-preview-235--es-eslint.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.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/62b1dcd03d1c6300081e18ab
😎 Deploy Preview https://deploy-preview-235--ja-eslint.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.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/62b1dcd08d145c000839d031
😎 Deploy Preview https://deploy-preview-235--hi-eslint.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.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for cn-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/cn-eslint/deploys/62b1dcd0cf10dc0008103c57
😎 Deploy Preview https://deploy-preview-235--cn-eslint.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.

@netlify
Copy link

netlify bot commented Jun 20, 2022

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 4df9c34
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/62b1dcd025c9be0009e59f14
😎 Deploy Preview https://deploy-preview-235--fr-eslint.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.

.eleventy.js Outdated
@@ -307,6 +307,15 @@ module.exports = eleventyConfig => {
eleventyConfig.addShortcode("image", imageShortcode)
// END, eleventy-img

/*
* Do not generate sitemap and sitemap index files for translation sites because we're
Copy link
Member

Choose a reason for hiding this comment

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

I think we should at least generate a shallow site map for translation sites. That will help if people are searching in other languages.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added multilingual: true to 6 pages that have translations (did I miss some?) and updated the sitemap template to include only pages with this property on translation sites.

Note that only 3 of those 6 appear in the sitemap because the other 3 have eleventyExcludeFromCollections: true.

Pages in the sitemap for translation sites:

Pages not in the sitemap because of eleventyExcludeFromCollections: true (was that intentional?):

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@nzakas nzakas merged commit f62dc26 into main Jun 21, 2022
@nzakas nzakas deleted the sitemap-index branch June 21, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sitemaps
2 participants