Skip to content

Commit

Permalink
Custom sitemap template to improve homepage rank
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed May 11, 2021
1 parent d7f9ff6 commit a5e4d74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ extra_javascript:
- js/gitter.js
- https://sidecar.gitter.im/dist/sidecar.v1.js

extra_templates:
- sitemap.xml

markdown_extensions:
- admonition
- attr_list
Expand Down
13 changes: 13 additions & 0 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{%- for file in pages -%}
{% if not file.page.is_link %}
<url>
<loc>{% if file.page.canonical_url %}{{ file.page.canonical_url|e }}{% else %}{{ file.page.abs_url|e }}{% endif %}</loc>
{% if file.page.update_date %}<lastmod>{{file.page.update_date}}</lastmod>{% endif %}
<changefreq>daily</changefreq>
<priority>{% if not file.page.url %}1.0{% else %}0.5{% endif %}</priority>
</url>
{%- endif -%}
{% endfor %}
</urlset>

0 comments on commit a5e4d74

Please sign in to comment.