-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
batlab
committed
Feb 18, 2017
1 parent
e4d6d7c
commit 682ac88
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% assign p_done = "404" %} | ||
{% for p in include.objects %} | ||
{% unless p.path contains ".xml" %} | ||
{% unless p.path contains ".scss" %} | ||
{% assign pname = p.path | split:"." | first %} | ||
{% assign p_done_arr = p_done | split:"," %} | ||
{% unless p_done_arr contains pname %} | ||
<url> | ||
<loc>{{ site.url }}{{ p.url | url_escape }}</loc> | ||
{% assign versions = include.objects | where_exp:"p","p.path contains pname" %} | ||
{% for v in versions %} | ||
<xhtml:link | ||
rel="alternate" | ||
hreflang="{{ v.lang }}" | ||
href="{{ site.url }}{{ v.url | url_escape }}" | ||
/> | ||
{% endfor %} | ||
{% assign p_done = p_done | append:"," | append:pname %} | ||
{% if p.layout == "post" %} | ||
<lastmod>{{ p.last_modified_at | default:p.date | date_to_xmlschema }}</lastmod> | ||
{% endif %} | ||
<changefreq>weekly</changefreq> | ||
{% if p.layout == "home" %} | ||
<priority>1</priority> | ||
{% endif %} | ||
</url> | ||
{% endunless %} | ||
{% endunless %} | ||
{% endunless %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaposts.org/schemas/sitemap/0.9" | ||
xmlns:xhtml="http://www.w3.org/1999/xhtml" > | ||
{% include sitemap-url.html objects=site.pages %} | ||
{% include sitemap-url.html objects=site.posts %} | ||
</urlset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
layout: sitemap | ||
--- |