jekyll-order 0.1.2 → 0.1.5

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: bae1f8910325bf7b98f91a7f7e0f63904630047e79abd802e2e573c7dd01f7f0
4
- data.tar.gz: '04808175c17720eb1cdedf87b5746b8148934cb35c19a7637990075eb371f15b'
3
+ metadata.gz: d2eaa1d87310e49898660718099113ec5f60d73389926f5c80f42d0c1bb0891a
4
+ data.tar.gz: 9dc3213d599e2ba9d24a4faec2055ece53854e4c52b68a414b04ef82bb19b3f5
5
5
  SHA512:
6
- metadata.gz: 5998ba142b16c8c9f7923c62fbc04a41f0c783188898b7518abf702a6b14ca0851d4cea817daacea1e41d81cea0281aa32212f35bf0d00fdc5c158f3ce6ce5e6
7
- data.tar.gz: 306eeb9bb6c68cfcc78594e724676d79aca16a19fba5a5620d816725256417b3bab96feb0f15e25b50b6c628a35ce382f3fd80c4dc823b5bd8cc8a61e96fab12
6
+ metadata.gz: ff9a975c54a7c37f5f64a7f863f3daf5ffa580c624686cc35ad6bb41baa0c342a7b73f07e0dcb14402fcbcb57e382c72bbba822b6d9d2354531ff283b0ff4d05
7
+ data.tar.gz: 1f1eb9fca5779ef097c7812089da0c23b93e40eb7503bb4692a4f53bafbc3b5510cc57c7c5717acdb71be1cda2a10869b70d29a5cc8f892f582fcfd349beccff
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /published/
10
+ Gemfile.lock
data/Makefile ADDED
@@ -0,0 +1,23 @@
1
+ gem := $(notdir $(PWD))
2
+
3
+ include .env
4
+
5
+ all: build publish sutty published
6
+
7
+ build:
8
+ echo $(gem)
9
+ chmod -R o=g .
10
+ gem build $(gem)
11
+
12
+ publish:
13
+ cloak view rubygems | xargs -rI {} gem push --otp {} *.gem
14
+
15
+ sutty:
16
+ gem inabox -o *.gem --host https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@gems.sutty.nl
17
+
18
+ published: always
19
+ mkdir -p published/
20
+ mv *.gem published/
21
+
22
+ .PHONY: always
23
+ always:
@@ -9,8 +9,7 @@ module Jekyll
9
9
  class SiteDrop
10
10
  def posts
11
11
  @site_posts ||= @obj.posts.docs.sort_by do |post|
12
- [post.data.fetch('order', @obj.posts.docs.size + 1),
13
- post.data['date']]
12
+ [post.data.dig('order').to_i, post.data['date']]
14
13
  end.reverse
15
14
  end
16
15
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Filters
5
+ module Order
6
+ def order(input)
7
+ return input unless input.respond_to? :sort_by
8
+
9
+ input.sort_by do |post|
10
+ [post.data.dig('order').to_i, post.data['date']]
11
+ end.reverse
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ Liquid::Template.register_filter(Jekyll::Filters::Order)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Order
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.5'
6
6
  end
7
7
  end
data/lib/jekyll-order.rb CHANGED
@@ -2,3 +2,4 @@
2
2
 
3
3
  require_relative 'jekyll/drops/site_drop'
4
4
  require_relative 'jekyll/archives/archive_decorator'
5
+ require_relative 'jekyll/filters/order'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-order
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2022-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,6 +49,7 @@ files:
49
49
  - CODE_OF_CONDUCT.md
50
50
  - Gemfile
51
51
  - LICENSE
52
+ - Makefile
52
53
  - README.md
53
54
  - Rakefile
54
55
  - bin/console
@@ -57,6 +58,7 @@ files:
57
58
  - lib/jekyll-order.rb
58
59
  - lib/jekyll/archives/archive_decorator.rb
59
60
  - lib/jekyll/drops/site_drop.rb
61
+ - lib/jekyll/filters/order.rb
60
62
  - lib/jekyll/order.rb
61
63
  - lib/jekyll/order/version.rb
62
64
  homepage: https://0xacab.org/sutty/jekyll/jekyll-order
@@ -82,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
84
  - !ruby/object:Gem::Version
83
85
  version: '0'
84
86
  requirements: []
85
- rubygems_version: 3.0.3
87
+ rubygems_version: 3.3.8
86
88
  signing_key:
87
89
  specification_version: 4
88
90
  summary: Jekyll plugin for numeric ordering of posts