Skip to content

Commit 77e8114

Browse files
committed
Add SEO optimization files: robots.txt and sitemap.xml
1 parent 8cb67a9 commit 77e8114

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

robots.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
User-agent: *
2+
Allow: /
3+
4+
# Disallow crawling of admin and private directories
5+
Disallow: /.git/
6+
Disallow: /.github/
7+
Disallow: /_site/
8+
Disallow: /node_modules/
9+
Disallow: /.sass-cache/
10+
Disallow: /.jekyll-cache/
11+
Disallow: /.bundle/
12+
Disallow: /vendor/
13+
14+
# Allow crawling of important files
15+
Allow: /css/
16+
Allow: /js/
17+
Allow: /img/
18+
Allow: /fonts/
19+
Allow: /feed.xml
20+
Allow: /sitemap.xml
21+
22+
# Sitemap location
23+
Sitemap: https://jasonrobert.me/sitemap.xml
24+
25+
# Crawl delay (optional - be respectful to search engines)
26+
Crawl-delay: 1

sitemap.xml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
layout: null
3+
---
4+
<?xml version="1.0" encoding="UTF-8"?>
5+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
6+
<!-- Homepage -->
7+
<url>
8+
<loc>{{ site.url }}/</loc>
9+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
10+
<changefreq>weekly</changefreq>
11+
<priority>1.0</priority>
12+
</url>
13+
14+
<!-- About page -->
15+
<url>
16+
<loc>{{ site.url }}/about/</loc>
17+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
18+
<changefreq>monthly</changefreq>
19+
<priority>0.8</priority>
20+
</url>
21+
22+
<!-- Archive page -->
23+
<url>
24+
<loc>{{ site.url }}/archive/</loc>
25+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
26+
<changefreq>weekly</changefreq>
27+
<priority>0.7</priority>
28+
</url>
29+
30+
<!-- Portfolio page -->
31+
<url>
32+
<loc>{{ site.url }}/portfolio/</loc>
33+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
34+
<changefreq>monthly</changefreq>
35+
<priority>0.6</priority>
36+
</url>
37+
38+
<!-- Blog posts -->
39+
{% for post in site.posts %}
40+
<url>
41+
<loc>{{ site.url }}{{ post.url }}</loc>
42+
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
43+
<changefreq>monthly</changefreq>
44+
<priority>0.9</priority>
45+
</url>
46+
{% endfor %}
47+
48+
<!-- Pages -->
49+
{% for page in site.pages %}
50+
{% unless page.url contains '/404' or page.url contains '/feed' or page.url contains '/sitemap' %}
51+
<url>
52+
<loc>{{ site.url }}{{ page.url }}</loc>
53+
<lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
54+
<changefreq>monthly</changefreq>
55+
<priority>0.5</priority>
56+
</url>
57+
{% endunless %}
58+
{% endfor %}
59+
</urlset>

0 commit comments

Comments
 (0)