jekyll-make-sitemap 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47032bf615eb1dfb10f4dc641186231ac228beb1bd82fc8422ec366aaa492065
4
- data.tar.gz: 620f5c30bc25c0bb2eb1dab6832df01353e7e9607fe468892f212b1cef815c65
3
+ metadata.gz: 16db4afb3d3c11c391bb3b66415273fc85911357a5a9fd9032f740533925c3b2
4
+ data.tar.gz: 448cffe8ddb49bf4945a08192214eacb11bde3892670d8a4a0cc1d61658b2ee3
5
5
  SHA512:
6
- metadata.gz: 98d2b849ac148cfcd8afa761851c417c18081aeeb6dda26094085fa52e73b769c26229bb51028e450f14e4ea5e3fe44c2e9106470fc006dc5386dec0dca2bd45
7
- data.tar.gz: e4f7eade9d29a237b33d31efe4401b8db072b70998ee532dbf75a006d7a3561e7d26ddd19b2bb8e720d82199798fc38ffe9076af0bd03c87351e232844f8d1b0
6
+ metadata.gz: f4458b5ea17b2942cc5381c94789a97167457c17b577b7d00e67e7ec4b9a40f1aea0f3247e7c742bf514a4a9cacdf61e4ac3673df52d54a43254b58604a0c818
7
+ data.tar.gz: 024267fbca6c40efc38cf0da7fc691cc0650f432e662d8dff0657fb8baf13b22730f4230d0d3a4c47499de5a551db965bf0d876758344dbcf3845d1986b2b615
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [1.2.0] - 2020-07-19
8
+
9
+ Added
10
+ - Ability to include posts by category in configuration
11
+
7
12
  ## [1.1.1] - 2020-07-12
8
13
 
9
14
  Added
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # [jekyll-make-sitemap](https://rubygems.org/gems/jekyll-make-sitemap)
2
2
  [![Gem Version](https://badge.fury.io/rb/jekyll-make-sitemap.svg)](https://badge.fury.io/rb/jekyll-make-sitemap)
3
3
 
4
- jekyll-make-sitemap is a Jekyll hook plugin for generating a `sitemap.txt` file during the Jekyll build process. If you're interested in generating an XML sitemap I recommend checking out [jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap).
4
+ A Jekyll hook plugin for generating a `sitemap.txt` file during the Jekyll build process. If you're interested in generating an XML sitemap I recommend checking out [jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap).
5
5
 
6
6
  This plugin includes all pages and posts by default. See the [Configuration](#Configuration) section for more on configuring your sitemap.
7
7
 
@@ -25,7 +25,8 @@ In `_config.yml`
25
25
  ``` yaml
26
26
  jekyll-make-sitemap:
27
27
  pages: true # Default: true
28
- posts: true # Default: true
28
+ posts: # Default: true
29
+ - category # Categories of posts to include in sitemap; accepts true, false, or a list of categories
29
30
  environments: # Default: ['production']
30
31
  - production
31
32
  - development
@@ -10,12 +10,22 @@ module Jekyll
10
10
  config = site.config.has_key?("jekyll-make-sitemap") ? site.config["jekyll-make-sitemap"] : default_config
11
11
  if config['environments'].include?(payload.jekyll.environment)
12
12
  baseurl = site.config["url"]
13
- collections = config.has_key?("collections") ? ["collections"] : []
13
+ collections = config.has_key?("collections") ? config["collections"] : []
14
14
  unless config.has_key?("pages") && config["pages"] == false
15
15
  payload.site.pages.each do |page| process(file, page, baseurl) end
16
16
  end
17
17
  unless config.has_key?("posts") && config["posts"] == false
18
- payload.site.posts.each do |post| process(file, post, baseurl) end
18
+ payload.site.posts.each do |post|
19
+ if !config["posts"].eql?(true)
20
+ config["posts"].each do |cat|
21
+ if post.data.has_key?("categories") && post.data["categories"].include?(cat)
22
+ process(file, post, baseurl)
23
+ end
24
+ end
25
+ else
26
+ process(file, post, baseurl)
27
+ end
28
+ end
19
29
  end
20
30
  collections.each do |col|
21
31
  site.collections[col].docs.each do |post| process(file, post, baseurl) end
@@ -1,7 +1,7 @@
1
1
  module Jekyll
2
2
  module Make
3
3
  class Sitemap
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-make-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Hofer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-07-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Jekyll hook plugin for generating a sitemap.txt file during the Jekyll
14
14
  build process.