summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2016-11-30 20:10:35 +0100
committerJelle van der Waa <jelle@vdwaa.nl>2017-05-02 21:13:56 +0200
commit5e56e7ff220971c6865f58eb18040ae7e6404c39 (patch)
treee5eb269bfdb0e88581ec0d1544d751e1ed8179bd
parent6489bd1a2e6faeff624efa93fa6f1b6f6535ca97 (diff)
downloadarchweb-5e56e7ff220971c6865f58eb18040ae7e6404c39.tar.gz
archweb-5e56e7ff220971c6865f58eb18040ae7e6404c39.zip
sitemap: port jinja templates to django
Port the .jinja templates to pure django templates
-rw-r--r--templates/sitemaps/news_sitemap.xml (renamed from templates/sitemaps/news_sitemap.xml.jinja)4
-rw-r--r--templates/sitemaps/sitemap.xml (renamed from templates/sitemaps/sitemap.xml.jinja)2
-rw-r--r--urls.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/templates/sitemaps/news_sitemap.xml.jinja b/templates/sitemaps/news_sitemap.xml
index 97dd17b5..1492ecce 100644
--- a/templates/sitemaps/news_sitemap.xml.jinja
+++ b/templates/sitemaps/news_sitemap.xml
@@ -2,12 +2,12 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
{% for url in urlset %}<url>
<loc>{{ url.location }}</loc>
-{% if url.lastmod %}<lastmod>{{ url.lastmod|date("Y-m-d") }}</lastmod>{% endif %}
+{% if url.lastmod %}<lastmod>{{ url.lastmod|date:"Y-m-d" }}</lastmod>{% endif %}
{% if url.changefreq %}<changefreq>{{ url.changefreq }}</changefreq>{% endif %}
{% if url.priority %}<priority>{{ url.priority }}</priority>{% endif %}
<news:news>
<news:publication><news:name>Arch Linux News</news:name><news:language>en</news:language></news:publication>
- {% if url.item.postdate %}<news:publication_date>{{ url.item.postdate|date("c") }}</news:publication_date>{% endif %}
+ {% if url.item.postdate %}<news:publication_date>{{ url.item.postdate|date:"c" }}</news:publication_date>{% endif %}
{% if url.item.title %}<news:title>{{ url.item.title }}</news:title>{% endif %}
</news:news>
</url>{% endfor %}
diff --git a/templates/sitemaps/sitemap.xml.jinja b/templates/sitemaps/sitemap.xml
index 0808a7de..50a95237 100644
--- a/templates/sitemaps/sitemap.xml.jinja
+++ b/templates/sitemaps/sitemap.xml
@@ -2,7 +2,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for url in urlset %}<url>
<loc>{{ url.location }}</loc>
-{% if url.lastmod %}<lastmod>{{ url.lastmod|date("Y-m-d") }}</lastmod>{% endif %}
+{% if url.lastmod %}<lastmod>{{ url.lastmod|date:"Y-m-d" }}</lastmod>{% endif %}
{% if url.changefreq %}<changefreq>{{ url.changefreq }}</changefreq>{% endif %}
{% if url.priority %}<priority>{{ url.priority }}</priority>{% endif %}
</url>{% endfor %}
diff --git a/urls.py b/urls.py
index 76271ece..134ce33e 100644
--- a/urls.py
+++ b/urls.py
@@ -84,11 +84,11 @@ urlpatterns += patterns('',
{'sitemaps': our_sitemaps, 'sitemap_url_name': 'sitemaps'}),
(r'^sitemap-(?P<section>.+)\.xml$',
cache_page(1831)(sitemap_views.sitemap),
- {'sitemaps': our_sitemaps, 'template_name': 'sitemaps/sitemap.xml.jinja'},
+ {'sitemaps': our_sitemaps, 'template_name': 'sitemaps/sitemap.xml'},
'sitemaps'),
(r'^news-sitemap\.xml$',
cache_page(1831)(sitemap_views.sitemap),
- {'sitemaps': news_sitemaps, 'template_name': 'sitemaps/news_sitemap.xml.jinja'},
+ {'sitemaps': news_sitemaps, 'template_name': 'sitemaps/news_sitemap.xml'},
'news-sitemap'),
)