jekyll-devto 0.3.0 → 0.3.1
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/CHANGELOG.md +7 -0
- data/lib/jekyll/devto/feed.xml +3 -2
- data/lib/jekyll/devto/html.rb +18 -2
- data/lib/jekyll/devto/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b8f57cf2fb543865943e101591c785ab55fa902cd77ea72a8022aa71d347074
|
|
4
|
+
data.tar.gz: 1f1797416470e4cb8391503f5141a19576091d96a0488150836e49df601a8b09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c6e5bea0a3edeaaa4ae757b432f0b43f3f2dcbb6b9997896e35ba27292e71b71805df4bc1040fef658c8b92b41a419c16a40ca5484b8492a9f0e8d1bc3db864
|
|
7
|
+
data.tar.gz: e84f567be97bcf106a10b0145483db93c2fb19d9ab04e308bf00e71ca5ad7eeeab031a34ce7a8732a4c693c48f5e9706a08cf7116b7b0af4873d99457e0a1951
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.1](https://github.com/JuanVqz/jekyll-devto/compare/v0.3.0...v0.3.1) (2026-10-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **feed:** ignore front matter values of the wrong type instead of crashing ([#16](https://github.com/JuanVqz/jekyll-devto/issues/16)) ([a890385](https://github.com/JuanVqz/jekyll-devto/commit/a890385ad4427fb2875f78e723d4f750eadcfb6b))
|
|
9
|
+
|
|
3
10
|
## [0.3.0](https://github.com/JuanVqz/jekyll-devto/compare/v0.2.0...v0.3.0) (2026-10-02)
|
|
4
11
|
|
|
5
12
|
|
data/lib/jekyll/devto/feed.xml
CHANGED
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
{%- if devto_tags %}
|
|
53
53
|
<devto:tags>{{ devto_tags | join: "," | xml_escape }}</devto:tags>
|
|
54
54
|
{%- endif %}
|
|
55
|
-
{%-
|
|
56
|
-
|
|
55
|
+
{%- assign devto_series = post.devto_series | devto_text %}
|
|
56
|
+
{%- if devto_series %}
|
|
57
|
+
<devto:series>{{ devto_series | xml_escape }}</devto:series>
|
|
57
58
|
{%- endif %}
|
|
58
59
|
<content:encoded>{{ post.content | devto_html: site_url | xml_escape }}</content:encoded>
|
|
59
60
|
</item>
|
data/lib/jekyll/devto/html.rb
CHANGED
|
@@ -87,7 +87,12 @@ module Jekyll
|
|
|
87
87
|
# { "path" => ... } hash; nil when there is nothing to point at.
|
|
88
88
|
def absolute_url(value, base_url)
|
|
89
89
|
path = value.is_a?(Hash) ? value['path'] : value
|
|
90
|
-
|
|
90
|
+
# Front matter is YAML, so this can be true, a number or a list; only a
|
|
91
|
+
# string is a path, anything else is ignored rather than crashing the build.
|
|
92
|
+
return unless path.is_a?(String)
|
|
93
|
+
|
|
94
|
+
path = path.strip
|
|
95
|
+
return if path.empty?
|
|
91
96
|
return path if path.match?(%r{\Ahttps?://})
|
|
92
97
|
return "#{base_url.to_s[/\A[a-z][a-z0-9+.-]*:/i] || 'https:'}#{path}" if path.start_with?('//')
|
|
93
98
|
|
|
@@ -126,11 +131,22 @@ module Jekyll
|
|
|
126
131
|
# string ("ruby, rails" or "ruby rails", as Jekyll accepts for tags), so
|
|
127
132
|
# the import and the publisher see the same tags. nil when there are none.
|
|
128
133
|
def devto_list(value)
|
|
129
|
-
list =
|
|
134
|
+
list = case value
|
|
135
|
+
when Array then value.filter_map { |item| devto_text(item) }
|
|
136
|
+
when String, Numeric then value.to_s.split(/[,\s]+/)
|
|
137
|
+
else []
|
|
138
|
+
end
|
|
130
139
|
list = list.map(&:strip).reject(&:empty?)
|
|
131
140
|
list unless list.empty?
|
|
132
141
|
end
|
|
133
142
|
|
|
143
|
+
# A front matter value as text when it is one (a string or a number);
|
|
144
|
+
# nil for true, false, lists and hashes, which mean nothing as a name.
|
|
145
|
+
def devto_text(value)
|
|
146
|
+
text = value.to_s.strip if value.is_a?(String) || value.is_a?(Numeric)
|
|
147
|
+
text unless text.to_s.empty?
|
|
148
|
+
end
|
|
149
|
+
|
|
134
150
|
def devto_url(value, base_url)
|
|
135
151
|
HTML.absolute_url(value, base_url).to_s
|
|
136
152
|
end
|
data/lib/jekyll/devto/version.rb
CHANGED