Skip to content

Commit

Permalink
feat(gh-pages): add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisha0 committed Oct 7, 2021
1 parent d6572e9 commit 94fb6de
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/views/_data/site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"url": "https://exadel-inc.github.io/ui-playground"
}
6 changes: 6 additions & 0 deletions pages/views/robots.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
permalink: "/robots.txt"
eleventyExcludeFromCollections: true
---
User-agent: *
Sitemap: {{ site.url }}/sitemap.xml
18 changes: 18 additions & 0 deletions pages/views/sitemap.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
permalink: "/sitemap.xml"
eleventyExcludeFromCollections: true
---

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in collections.all %}
<url>
<loc>{{ site.url }}{{ page.url.replace(r/\/$/, ".html") if page.data.tags else page.url }}</loc>
<lastmod>{{ page.date.toISOString() }}</lastmod>
{%- if page.url == "/" %}
<changefreq>weekly</changefreq>
<priority>1.0</priority>
{%- endif %}
</url>
{% endfor %}
</urlset>

0 comments on commit 94fb6de

Please # to comment.