rawfeed 0.2.1 → 0.2.3

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: f09acc0cf4690a53a80caa3f68091347d4bb4e97cb97114c56e2002be5c00f67
4
- data.tar.gz: 90c102ca73db5d4e8afb0893498f0dae50508e925cfbded8b2f40f708d635edf
3
+ metadata.gz: 50b245b38494f90cb2b64a2fd9aad4b55aa10f5d64ba81fdcea2718243af80df
4
+ data.tar.gz: 28464325f5f2aa95e90c134a098f5b2748680c0a704bbbb8ce7ff0d20fdfaeae
5
5
  SHA512:
6
- metadata.gz: 6901aa597497a7808db62eddf7dd58a4e10a6384c6237aa92364933286592a917dcbe53a27d26ebcc58d216ad3c77e145f5cd5fda643ba4bda94236b7eeab46d
7
- data.tar.gz: 65d05a8b67428006cd4883a65a026b762af6a63b0b0662284a02446513524f2d9861990a23c8829b2058fe7e10699749b23e32f0ae3fa671178aa5774844d14e
6
+ metadata.gz: 127935e66fcfbeff961e4f247cd9a56f21d3719bce0f81bfc7b3001bb14f301f343fb9df798dda119443819bcdff65be9fbf35b4cd2b249832491026d565389a
7
+ data.tar.gz: bb64a8dc51e37c6fcac8d4f23898a79abe82aff935d6f72da2eefe6b349a8045faf3c2fe803770b5e601d8133335971c119da899773a01b265d1e30d55a2f9bd
@@ -14,9 +14,9 @@ module Rawfeed
14
14
  def render(context)
15
15
  site = context.registers[:site]
16
16
  page = context.registers[:page] || {}
17
- config = site.config
17
+ options = site.data['options']
18
18
 
19
- locale = config.dig("datelang", "lang") || "en_US"
19
+ locale = options.dig("datelang", "lang") || "en_US"
20
20
 
21
21
  json_path = File.join(site.source, "assets", "json", "datelang.json")
22
22
  json_path = File.expand_path("../../assets/json/datelang.json", __dir__) unless File.exist?(json_path)
data/lib/rawfeed/page.rb CHANGED
@@ -17,7 +17,7 @@ module Rawfeed
17
17
  file.puts("author: # \"Your Name\"")
18
18
  file.puts("title: \"#{array[0]}\"")
19
19
  file.puts("order: #number")
20
- file.puts("emoji: 😃  # Add an emoji to the page menu or leave it blank")
20
+ file.puts("emoji: 😃 # Add an emoji to the page menu or leave it blank")
21
21
  file.puts("date: #{array[2]} -0300")
22
22
  file.puts("update_date: ")
23
23
  file.puts("in_menu: true")
@@ -3,10 +3,11 @@ require "jekyll"
3
3
  module Rawfeed
4
4
  module ReadingTimeFilter
5
5
  def reading_time(input)
6
- site_config = Jekyll.sites.first.config rescue {}
7
- words_per_minute = site_config&.dig("reading_time", "words_per_minute") || 180
8
- message = site_config&.dig("reading_time", "message") || ["Read this post in", "Read this post in less than"]
9
- minutes_text = site_config&.dig("reading_time", "minutes_label") || ["minute", "minutes"]
6
+ site = Jekyll.sites.first rescue nil
7
+ options_data = site&.data&.dig("options") rescue {}
8
+ words_per_minute = options_data&.dig("reading_time", "words_per_minute") || 180
9
+ message = options_data&.dig("reading_time", "message") || ["Read this post in", "Read this post in less than"]
10
+ minutes_text = options_data&.dig("reading_time", "minutes_label") || ["minute", "minutes"]
10
11
  words = input.split.size;
11
12
  minutes = ( words / words_per_minute ).floor
12
13
  minutes_label = minutes == 1 ? "#{minutes_text[0]}" : "#{minutes_text[1]}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rawfeed
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rawfeed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William C. Canin