jekyll-linked-posts 0.5.0 → 0.5.2
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 +4 -4
- data/lib/jekyll/linked_posts.rb +9 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f33a1274ec184b4bc5cf5b9c7317303469d5d6ef479516d61e010763afd299b9
|
4
|
+
data.tar.gz: 75ed922deb0dc1fc5e2fa85abc2e535c511e02fabda4598d70c70bd0cd4b3306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a151129dac5c6e6daa99386e6c97ab420cc2e5a6ed63d220f7628d058eed48c3702bb4597938e0601998cb116a9339b6d4404a67c3c28e37120df2a5c9328e35
|
7
|
+
data.tar.gz: b26e964cda97e97c6a4ca571b4e59de63b4cf25021af5920420e8e1d87f8c48075fb78eab98a917319abb9256262eec3b06073dcd66913f5dc0f3ecb6e58e714
|
data/lib/jekyll/linked_posts.rb
CHANGED
@@ -20,11 +20,7 @@ module Jekyll
|
|
20
20
|
# If it doesn't find anything it'll show a warning and replace the
|
21
21
|
# value for nil.
|
22
22
|
def read
|
23
|
-
|
24
|
-
process doc
|
25
|
-
end
|
26
|
-
|
27
|
-
site.pages.each do |doc|
|
23
|
+
indexable_documents.each do |doc|
|
28
24
|
process doc
|
29
25
|
end
|
30
26
|
end
|
@@ -60,6 +56,10 @@ module Jekyll
|
|
60
56
|
nil
|
61
57
|
end
|
62
58
|
|
59
|
+
def indexable_documents
|
60
|
+
@indexable_documents ||= site.documents + site.pages
|
61
|
+
end
|
62
|
+
|
63
63
|
# The field to index posts by
|
64
64
|
#
|
65
65
|
# @return [String] by default uuid
|
@@ -73,7 +73,7 @@ module Jekyll
|
|
73
73
|
#
|
74
74
|
# @return [Hash]
|
75
75
|
def indexed_documents
|
76
|
-
@indexed_documents ||=
|
76
|
+
@indexed_documents ||= indexable_documents.reduce({}) do |docs, doc|
|
77
77
|
index_value = doc.data[indexed_field]
|
78
78
|
|
79
79
|
unless index_value
|
@@ -114,6 +114,9 @@ module Jekyll
|
|
114
114
|
#
|
115
115
|
# @return [Jekyll::Document,Nil]
|
116
116
|
def find(value)
|
117
|
+
return value if value.is_a? Jekyll::Document
|
118
|
+
return value if value.is_a? Jekyll::Page
|
119
|
+
|
117
120
|
indexed_documents[value].tap do |i|
|
118
121
|
Jekyll.logger.warn "#{value} couldn't be found" if i.nil?
|
119
122
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-linked-posts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|