Skip to content

Commit 58324f1

Browse files
committed
Added sitemap
1 parent 462ecc4 commit 58324f1

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

_includes/base_path

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% if site.url %}
2+
{% assign base_path = site.url | append: site.baseurl %}
3+
{% else %}
4+
{% assign base_path = site.github.url %}
5+
{% endif %}

_pages/site-map.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: archive
3+
title: "Site Map"
4+
permalink: /sitemap/
5+
author_profile: false
6+
---
7+
8+
{% include base_path %}
9+
10+
A list of all the posts and pages found on the site. For you robots out there is an [XML version]({{ base_path }}/sitemap.xml) available for digesting as well.
11+
12+
<h2>Pages</h2>
13+
{% for post in site.pages %}
14+
{% include archive-single.html %}
15+
{% endfor %}
16+
17+
<h2>Posts</h2>
18+
{% for post in site.posts %}
19+
{% include archive-single.html %}
20+
{% endfor %}
21+
22+
{% capture written_label %}'None'{% endcapture %}
23+
24+
{% for collection in site.collections %}
25+
{% unless collection.output == false or collection.label == "posts" %}
26+
{% capture label %}{{ collection.label }}{% endcapture %}
27+
{% if label != written_label %}
28+
<h2>{{ label }}</h2>
29+
{% capture written_label %}{{ label }}{% endcapture %}
30+
{% endif %}
31+
{% endunless %}
32+
{% for post in collection.docs %}
33+
{% unless collection.output == false or collection.label == "posts" %}
34+
{% include archive-single.html %}
35+
{% endunless %}
36+
{% endfor %}
37+
{% endfor %}

0 commit comments

Comments
 (0)