-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: gh-pages
Are you sure you want to change the base?
Changes from all commits
e11d5d5
6a06617
19b4f46
fa6a3d9
f86e9a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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 | ||
--- |
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> | ||
<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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. link explains about external link in |
||
<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> | ||
ShubhamOulkar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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