Sha256: 2d9052007bde43a7559cd9bce04466a1a73de28847b55090cbdfeba8ac1227eb

Contents?: true

Size: 998 Bytes

Versions: 2

Compression:

Stored size: 998 Bytes

Contents

<?xml version="1.0" encoding="UTF-8"?>
  {% 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 %}
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
      <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>
    {% endif %}
  {% endfor %}


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-news-sitemap-0.2.0 lib/sitemap_news.xml
jekyll-news-sitemap-0.1.5 lib/sitemap_news.xml