Skip to content

Commit 8d73e20

Browse files
committed
Add a sitemap
1 parent f7f2dec commit 8d73e20

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

src/404.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Not Found
33
layout: prose
44
permalink: 404.html
5+
eleventyExcludeFromCollections: true
56
---
67

78
# Not Found

src/index.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: base
33
title: JavaScriptMN
4+
changeFreq: daily
45
---
56

67
{# primary content #}

src/robots.njk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
permalink: /robots.txt
3+
eleventyExcludeFromCollections: true
4+
---
5+
User-agent: *
6+
Allow: /
7+
8+
Sitemap: {{ site.url }}{{ '/sitemap.xml' | url }}

src/sitemap.njk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
permalink: /sitemap.xml
3+
layout: null
4+
eleventyExcludeFromCollections: true
5+
---
6+
<?xml version="1.0" encoding="utf-8"?>
7+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
8+
{% for page in collections.all %}
9+
<url>
10+
<loc>{{ site.url }}{{ page.url | url }}</loc>
11+
<lastmod>{{ page.date.toISOString() }}</lastmod>
12+
<changefreq>{{ page.data.changeFreq }}</changefreq>
13+
</url>
14+
{% endfor %}
15+
</urlset>

0 commit comments

Comments
 (0)