lib/sitemap_news.xml in jekyll-news-sitemap-0.1.3 vs lib/sitemap_news.xml in jekyll-news-sitemap-0.1.4
- old
+ new
@@ -1,34 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<urlset>
{% assign timeframe = 172800 %}
-
{% assign posts = site.posts | where_exp:'doc','doc.sitemap != false' %}
{% for post in posts %}
{% assign post_in_seconds = post.date | date: "%s" | plus: 0 %}
{% assign recent_posts = "now" | date: "%s" | minus: timeframe %}
-
{% if post_in_seconds > recent_posts %}
+ <url>
+ <loc>{{ post.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
- http://www.google.com/schemas/sitemap-news/0.9
- http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">
-
- <url>
- <loc>{{ post.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
-
- <news:news>
- <news:publication>
- <news:name>{{site.publisher}}</news:name>
- <news:language>en</news:language>
- </news:publication>
- <news:publication_date>{{ post.date | date_to_xmlschema }}</news:publication_date>
- <news:title>{{ post.title }}</news:title>
- </news:news>
- </url>
- </urlset>
+ <news:news>
+ <news:publication>
+ <news:name>{{site.publisher}}</news:name>
+ <news:language>en</news:language>
+ </news:publication>
+ <news:publication_date>{{ post.date | date_to_xmlschema }}</news:publication_date>
+ <news:title>{{ post.title }}</news:title>
+ </news:news>
+ </url>
{% endif %}
{% endfor %}
+</urlset>
+