2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 17:10:29 +01:00

Merge pull request #5 from offen/sitemap

Render sitemap via pelican template
This commit is contained in:
Frederik Ring 2019-10-24 13:21:58 +02:00 committed by GitHub
commit fefd7cebc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View File

@ -3,6 +3,7 @@ description: offen is a free and open source analytics software for websites and
save_as: 404.html save_as: 404.html
href: /404.html href: /404.html
no_stats: true no_stats: true
exclude_from_sitemap: true
![Page not Found](/theme/images/content-404.webp){:class="image-text-560-315"} ![Page not Found](/theme/images/content-404.webp){:class="image-text-560-315"}

View File

@ -1,6 +1,7 @@
Title: Opt-out | offen Title: Opt-out | offen
description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data. description: offen is a free and open source analytics software for websites and web applications that allows respectful handling of data.
save_as: opt-out/index.html save_as: opt-out/index.html
exclude_from_sitemap: true
## You are opted out ## You are opted out

View File

@ -18,6 +18,8 @@ TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None AUTHOR_FEED_RSS = None
SITEURL = 'http://localhost:8000'
# pagination # pagination
DEFAULT_PAGINATION = False DEFAULT_PAGINATION = False
@ -33,7 +35,8 @@ CATEGORIES_SAVE_AS = None
TAGS_SAVE_AS = None TAGS_SAVE_AS = None
# keep this for access to page variable # keep this for access to page variable
DIRECT_TEMPLATES = [] DIRECT_TEMPLATES = ['sitemap']
SITEMAP_SAVE_AS = 'sitemap.xml'
PLUGIN_PATHS = ['./plugins'] PLUGIN_PATHS = ['./plugins']
PLUGINS = ['assets'] PLUGINS = ['assets']

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in pages %}
{% if not page.exclude_from_sitemap %}
<url>
<loc>{{ SITEURL }}{{ page.href }}</loc>
<priority>{{ page.sitemap_priority or 1.0 }}</priority>
</url>
{% endif %}
{% endfor %}
</urlset>