diff --git a/homepage/content/pages/404.md b/homepage/content/pages/404.md index db7f3d3..42dfbc5 100644 --- a/homepage/content/pages/404.md +++ b/homepage/content/pages/404.md @@ -3,6 +3,7 @@ description: offen is a free and open source analytics software for websites and save_as: 404.html href: /404.html no_stats: true +exclude_from_sitemap: true ![Page not Found](/theme/images/content-404.webp){:class="image-text-560-315"} diff --git a/homepage/content/pages/opt-out.md b/homepage/content/pages/opt-out.md index 80af01c..5bdf07e 100644 --- a/homepage/content/pages/opt-out.md +++ b/homepage/content/pages/opt-out.md @@ -1,6 +1,7 @@ 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. save_as: opt-out/index.html +exclude_from_sitemap: true ## You are opted out diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index 9cc5867..5fd4540 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -18,6 +18,8 @@ TRANSLATION_FEED_ATOM = None AUTHOR_FEED_ATOM = None AUTHOR_FEED_RSS = None +SITEURL = 'http://localhost:8000' + # pagination DEFAULT_PAGINATION = False @@ -33,7 +35,8 @@ CATEGORIES_SAVE_AS = None TAGS_SAVE_AS = None # keep this for access to page variable -DIRECT_TEMPLATES = [] +DIRECT_TEMPLATES = ['sitemap'] +SITEMAP_SAVE_AS = 'sitemap.xml' PLUGIN_PATHS = ['./plugins'] PLUGINS = ['assets'] diff --git a/homepage/theme/templates/sitemap.html b/homepage/theme/templates/sitemap.html new file mode 100644 index 0000000..0a6716a --- /dev/null +++ b/homepage/theme/templates/sitemap.html @@ -0,0 +1,11 @@ + + +{% for page in pages %} + {% if not page.exclude_from_sitemap %} + + {{ SITEURL }}{{ page.href }} + {{ page.sitemap_priority or 1.0 }} + + {% endif %} +{% endfor %} +