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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5d68c73dff2c64c76de9bd3e8fc0d9e130d89cc9abc0f49473b69ce4d55a2e3
4
- data.tar.gz: 791dfd16298f0b7d0ca0126594419a812fc3a84aa3da46e0c8da7690a6a45c0a
3
+ metadata.gz: 9b8f57cf2fb543865943e101591c785ab55fa902cd77ea72a8022aa71d347074
4
+ data.tar.gz: 1f1797416470e4cb8391503f5141a19576091d96a0488150836e49df601a8b09
5
5
  SHA512:
6
- metadata.gz: 38c78047e58a1557a7327d3b95104342bf5920ce365dfb3ea3c8665227ab83297c0c9bed6dd0e30ea1a499e5af28d8b7b7fcc24374c5e234384dec4116c722c2
7
- data.tar.gz: 92cc3df16600b846a8a08868033f54e051e7415d747671a0e88e730c95f7e220e942eb14b3be61700e181a08a220db23ec9ea4836140b1cc07220c674231d3d4
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
 
@@ -52,8 +52,9 @@
52
52
  {%- if devto_tags %}
53
53
  <devto:tags>{{ devto_tags | join: "," | xml_escape }}</devto:tags>
54
54
  {%- endif %}
55
- {%- if post.devto_series %}
56
- <devto:series>{{ post.devto_series | xml_escape }}</devto:series>
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>
@@ -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
- return if path.to_s.empty?
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 = value.is_a?(Array) ? value.map(&:to_s) : value.to_s.split(/[,\s]+/)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Devto
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-devto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Vásquez