jekyll-news-sitemap 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecc87535befbdb06bdeb3a494012f4945e3cb09a813dd29eacc9aad75fad03e2
4
- data.tar.gz: d417ae79c4b21ccd88ed4016bb2452e84a6c0dd980d68abdc18bc041a75b36a1
3
+ metadata.gz: 8453640a887a8b6c369bd37ad0e0737f5bd6cf2d1c69027d7379b93a1186f6f2
4
+ data.tar.gz: abc3a1baa694c34f2954e75dbf75c35eeb24fdd3bac0791d3eb7e2c0e6ab058a
5
5
  SHA512:
6
- metadata.gz: 6bbab0f46227c8a9c7a6f5f271d9bf066f0844935b6943c261c613fb6fcb13fb289029c5871a20faa6959f0ab9464655f474404a6648682b7c8f6a554de157e6
7
- data.tar.gz: 4791ea5c9a93b7dda913b6e7157d8c77838e39183071b30b5e482e54e7fbc1ed7a5272dc0aaab3d8279a2b8642aa7aba3e9d1e290f003aba6cf1ca2b7c41bb5b
6
+ metadata.gz: cd959336abb4c4c6f569438bd3b7d8f5873328107fa1ba6155501dbfec08609fe94d4603e51296563e429f21c1d634223fdfb94635b066ae7aaa15130b1021d9
7
+ data.tar.gz: 142a69a2dcc155f90318206fd90e5ba49411ad8ad5ea15243840e9bc5a93192112d6039d61fb82350cb27ee9d487038454289bf228c928885ce2922b2e3e1ae8
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.3]
8
+ ### Change
9
+ - Return empty XML if there are no posts in last two days
10
+
7
11
  ## [0.1.2]
8
12
  ### Added
9
13
  - Adding schema link to sitemap file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-news-sitemap (0.1.2)
4
+ jekyll-news-sitemap (0.1.3)
5
5
  jekyll (>= 3.7, < 5.0)
6
6
 
7
7
  GEM
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module NewsSitemap
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/sitemap_news.xml CHANGED
@@ -1,33 +1,34 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
 
3
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
4
- xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
5
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
7
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
8
- http://www.google.com/schemas/sitemap-news/0.9
9
- http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">
10
-
11
3
  {% assign timeframe = 172800 %}
12
4
 
13
5
  {% assign posts = site.posts | where_exp:'doc','doc.sitemap != false' %}
14
6
  {% for post in posts %}
15
7
  {% assign post_in_seconds = post.date | date: "%s" | plus: 0 %}
16
8
  {% assign recent_posts = "now" | date: "%s" | minus: timeframe %}
17
-
9
+
18
10
  {% if post_in_seconds > recent_posts %}
19
- <url>
20
- <loc>{{ post.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
21
11
 
22
- <news:news>
23
- <news:publication>
24
- <news:name>{{site.publisher}}</news:name>
25
- <news:language>en</news:language>
26
- </news:publication>
27
- <news:publication_date>{{ post.date | date_to_xmlschema }}</news:publication_date>
28
- <news:title>{{ post.title }}</news:title>
29
- </news:news>
30
- </url>
12
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
13
+ xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
14
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
15
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
16
+ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd
17
+ http://www.google.com/schemas/sitemap-news/0.9
18
+ http://www.google.com/schemas/sitemap-news/0.9/sitemap-news.xsd">
19
+
20
+ <url>
21
+ <loc>{{ post.url | replace:'/index.html','/' | absolute_url | xml_escape }}</loc>
22
+
23
+ <news:news>
24
+ <news:publication>
25
+ <news:name>{{site.publisher}}</news:name>
26
+ <news:language>en</news:language>
27
+ </news:publication>
28
+ <news:publication_date>{{ post.date | date_to_xmlschema }}</news:publication_date>
29
+ <news:title>{{ post.title }}</news:title>
30
+ </news:news>
31
+ </url>
32
+ </urlset>
31
33
  {% endif %}
32
34
  {% endfor %}
33
- </urlset>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-news-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Katkov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll