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: generate sitemap.xml for SEO indexing #1838

Open
wants to merge 5 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion 2x/applications.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/contrib.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/applications.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/contrib.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/executable.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/docs/screencasts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/executable.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/guide.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
3 changes: 2 additions & 1 deletion 2x/screencasts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
redirect_to:
sitemap: false
redirect_to:
- https://github.com/expressjs/expressjs.com/tree/2x
---
1 change: 1 addition & 0 deletions en/changelog/index.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ layout: page
title: Express changelog
description: Stay updated with the release changelog for Express.js, detailing new features, bug fixes, and important changes across versions.
lang: en
sitemap: false
redirect_from:
- "/changelog/4x.html"
- "en/changelog/4x.html"
1 change: 1 addition & 0 deletions id/changelog/index.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ menu: changelog
lang: id
redirect_from:
- "id/changelog/4x.html"
sitemap: false
---

# Release changelog
1 change: 1 addition & 0 deletions ko/changelog/4x.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ menu: changelog
lang: ko
description: Stay updated with the release change log for Express.js 4.x, detailing
new features, bug fixes, and important changes across versions.
sitemap: false
---

# 업데이트 기록
85 changes: 85 additions & 0 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: null
sitemap: false
---
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{% for lang in site.data.languages %}
<url>
{% if lang.code == 'en' %}
<loc>{{site.url}}</loc>
{% else %}
<loc>{{site.url}}/{{ lang.code }}/</loc>
{% endif %}
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
Copy link
Member

Choose a reason for hiding this comment

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

Is this a good practice? We still don't have the option to specify when the file was last modified, something we should add in the future. But as you're proposing, it takes the date the website was built, which I'm not sure is a good practice for Google.

Copy link
Member Author

@ShubhamOulkar ShubhamOulkar Mar 24, 2025

Choose a reason for hiding this comment

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

Agreed on it should be last modified time. And it is good practice recommend on google developer docs. I think this page has full explanation.
This is something I’m interested in working on. I want to use a custom plugin from https://github.com/michaelx/jekyll-last-modified

<xhtml:link rel="alternate" hreflang="x-default" href="{{ site.url }}" />
{% for alt_lang in site.data.languages %}
{% if alt_lang.code == 'en' %}
<xhtml:link rel="alternate" hreflang="en" href="{{ site.url }}" />
{% else %}
<xhtml:link rel="alternate" hreflang="{{ alt_lang.code }}" href="{{ site.url }}/{{ alt_lang.code }}/" />
{% endif %}
{% endfor %}
</url>
{% endfor %}
{% for page in site.html_pages %}
{% assign clean_url = page.url | split: '/' | slice: 2, page.url.size | join: '/' %}
{% if clean_url.size > 0 %}
{% if page.layout != 404 and page.sitemap != false %}
<url>
<loc>{{site.url}}{{ page.url}}</loc>
<xhtml:link rel="alternate" hreflang="x-default" href="{{ site.url }}/en/{{ clean_url }}" />
{% for lang in site.data.languages %}
<xhtml:link rel="alternate" hreflang="{{ lang.code }}" href="{{ site.url }}/{{ lang.code }}/{{ clean_url }}" />
{% endfor %}
</url>
{% endif %}
{% endif %}
{% endfor %}
<url>
<loc>https://expressjs.com/en/changelog/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
{% for post in site.posts %}
<url>
<loc>{{site.url}}{{post.url}}</loc>
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
</url>
{% endfor %}
<url>
<loc>https://nodejs.org/en/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://www.netlify.com/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
Comment on lines +53 to +56
Copy link
Member

@bjohansebas bjohansebas Mar 23, 2025

Choose a reason for hiding this comment

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

I don't think we should add Netlify. I understand the others, as they are part of the foundation, but Netlify is not.

And having bots detect Netlify, I don't think that's our priority.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, may be help them in page ranking. I will remove it.

should be add robot.txt to reference sitemap.xml? Jekyll itself doesn’t require a file, but it can be useful for controlling how search engines crawl site.

Copy link
Member Author

Choose a reason for hiding this comment

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

link explains about external link in You might need a sitemap section.

<url>
<loc>https://openjsf.org/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://terms-of-use.openjsf.org/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://privacy-policy.openjsf.org/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://trademark-policy.openjsf.org/</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://github.com/expressjs/express/security/policy</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
<url>
<loc>https://github.com/expressjs/express/blob/master/LICENSE</loc>
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
</url>
</urlset>
1 change: 1 addition & 0 deletions th/changelog/index.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ menu: changelog
lang: th
redirect_from:
- "th/changelog/4x.html"
sitemap: false
---

# Release changelog
1 change: 1 addition & 0 deletions tr/changelog/4x.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ menu: changelog
lang: tr
description: Stay updated with the release change log for Express.js 4.x, detailing
new features, bug fixes, and important changes across versions.
sitemap: false
---
<div id="page-doc" markdown="1">
# Release Change Log
3 changes: 3 additions & 0 deletions uk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
sitemap: false
---
18.03.2016 Додано сторінки для наступних лінків:
* http://expressjs.com/uk/starter/static-files.html (у головному меню)
* http://expressjs.com/uk/guide/writing-middleware.html (у головному меню)