Skip to content

Commit

Permalink
Add "no_sitemap" option for page
Browse files Browse the repository at this point in the history
  • Loading branch information
naspeh committed Oct 16, 2020
1 parent b82d84c commit 1c727df
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/en/tider/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Moved info to github <https://github.com/naspeh/tider>
<script>
// moved info to github
window.location.replace("https://github.com/naspeh/tider");
</script>
4 changes: 4 additions & 0 deletions data/en/tider/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"modified": "2020-10-16 17:00",
"no_sitemap": true
}
3 changes: 3 additions & 0 deletions data/s/tea/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"no_sitemap": true
}
2 changes: 1 addition & 1 deletion data/sitemap.xml.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in p.pages.values() %}
{% if page.url | match('^/($|(post|trip|s|naspeh|en|mailur)/)') and not page.url | match('.*/photos/.*') and page.index_file %}
{% if page.url | match('^/($|(post|trip|s|naspeh|en|mailur)/)') and not page.no_sitemap and page.index_file %}
<url>
<loc>{{ host }}{{ page.url }}</loc>
</url>
Expand Down
3 changes: 2 additions & 1 deletion pusto.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Page:
__slots__ = ('_data', '_xml')
meta_fields = (
'template params aliases published modified sort archive author title '
'terms_file photos'.split()
'terms_file photos no_sitemap'.split()
)
fields = meta_fields + (
'pages url src_dir index_file meta_file summary body text kind'.split()
Expand Down Expand Up @@ -638,6 +638,7 @@ def process_photos(build_dir):
meta = {
'title': 'Photos',
'photos': items,
'no_sitemap': True,
}
meta_json = json.dumps(meta, indent=4, sort_keys=True)
(path / 'meta.json').write_text(meta_json)
Expand Down

0 comments on commit 1c727df

Please sign in to comment.