rawfeed 0.1.0 → 0.1.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.
@@ -14,7 +14,19 @@
14
14
  list-style: disc;
15
15
  }
16
16
 
17
+ .comments {
18
+ &-title {
19
+ font-size: 1rem !important;
20
+ }
21
+ }
22
+
23
+ &-reading_time {
24
+ color: var(--text-muted-color);
25
+ margin: 12px 0px;
26
+ }
27
+
17
28
  &-title {
29
+ margin-top: 0px !important;
18
30
  font-size: 1.3rem !important;
19
31
  font-weight: bold;
20
32
  margin-bottom: 40px !important;
@@ -46,6 +58,10 @@
46
58
  .related-posts {
47
59
  margin-bottom: 80px;
48
60
 
61
+ li {
62
+ list-style: none !important;
63
+ }
64
+
49
65
  &-title {
50
66
  font-size: 1.05rem;
51
67
  font-weight: bold;
@@ -65,7 +81,7 @@
65
81
 
66
82
  &__meta {
67
83
  display: inline-block;
68
- min-width: 100px;
84
+ min-width: 115px !important;
69
85
  font-family: "SUSE Mono", sans-serif;
70
86
  font-optical-sizing: auto;
71
87
  font-style: normal;
@@ -80,28 +96,6 @@
80
96
  }
81
97
  }
82
98
 
83
- /* reset table values in <pre> */
84
- pre {
85
- code {
86
-
87
- table,
88
- tbody {
89
- all: unset !important;
90
- }
91
-
92
- table {
93
- tbody {
94
-
95
- td,
96
- tr {
97
- border: none !important;
98
- background-color: transparent !important;
99
- }
100
- }
101
- }
102
- }
103
- }
104
-
105
99
  &-end {
106
100
  margin: 40px 0px;
107
101
  font-size: 1.2rem;
@@ -169,7 +169,8 @@
169
169
  }
170
170
  }
171
171
 
172
- .time {
172
+ .time,
173
+ .hours {
173
174
  font-size: 9.5pt;
174
175
  color: var(--resume-text-muted-color);
175
176
  }
@@ -252,6 +253,26 @@
252
253
 
253
254
  }
254
255
 
256
+ .certificate {
257
+ margin-bottom: 12px;
258
+
259
+ .company {
260
+ margin-left: 12px;
261
+
262
+ .caption {
263
+ font-weight: bold;
264
+ }
265
+ }
266
+
267
+ .period {
268
+ margin-left: 12px;
269
+
270
+ .caption {
271
+ font-weight: bold;
272
+ }
273
+ }
274
+ }
275
+
255
276
  .publications {
256
277
  .section-item {
257
278
  .row {
@@ -297,6 +318,16 @@
297
318
  margin-top: 12px;
298
319
  }
299
320
  }
321
+
322
+ .markdown {
323
+ margin-bottom: 12px;
324
+
325
+ .section-content {
326
+ ul {
327
+ padding: 0 !important;
328
+ }
329
+ }
330
+ }
300
331
  }
301
332
 
302
333
  a {
@@ -3,7 +3,10 @@ document.addEventListener("DOMContentLoaded", () => {
3
3
  --------------------------------------------------------------------------------------------------
4
4
  */
5
5
  const terminal = document.getElementById("terminal");
6
- const btnMax = terminal.querySelector(".terminal-header__max");
6
+
7
+ if (!terminal) return;
8
+
9
+ const btnMax = terminal.querySelector(".terminal-header__max");
7
10
 
8
11
  let isFullscreen = false;
9
12
 
data/assets/js/toc.js CHANGED
@@ -2,6 +2,8 @@ document.addEventListener("DOMContentLoaded", () => {
2
2
  /* TOC in top */
3
3
  const toc = document.getElementById('toc');
4
4
 
5
+ if (!toc) return;
6
+
5
7
  const sentinel = document.createElement('div');
6
8
  toc.parentNode.insertBefore(sentinel, toc);
7
9
 
@@ -2,7 +2,7 @@
2
2
  layout: none
3
3
  ---
4
4
 
5
- {%- assign date_format = "%b %-d,%Y" -%}
5
+ {%- assign date_format = site.datelang.format -%}
6
6
 
7
7
  [
8
8
  {% for post in site.posts %}
@@ -10,7 +10,7 @@ layout: none
10
10
  "title" : "{{ post.title | escape }}",
11
11
  "tags" : "{{ post.tags | join: ', ' }}",
12
12
  "url" : "{{ site.baseurl }}{{ post.url }}",
13
- "date" : "{{ post.date | date: date_format }}"
13
+ "date" : "{% datelang post.date format:date_format %}"
14
14
  } {% unless forloop.last %},{% endunless %}
15
15
  {% endfor %}
16
16
  ]
@@ -0,0 +1,290 @@
1
+ {
2
+ "en_US": {
3
+ "months_full": [
4
+ "",
5
+ "January",
6
+ "February",
7
+ "March",
8
+ "April",
9
+ "May",
10
+ "June",
11
+ "July",
12
+ "August",
13
+ "September",
14
+ "October",
15
+ "November",
16
+ "December"
17
+ ],
18
+ "months_short": [
19
+ "",
20
+ "Jan",
21
+ "Feb",
22
+ "Mar",
23
+ "Apr",
24
+ "May",
25
+ "Jun",
26
+ "Jul",
27
+ "Aug",
28
+ "Sep",
29
+ "Oct",
30
+ "Nov",
31
+ "Dec"
32
+ ]
33
+ },
34
+ "pt_PT": {
35
+ "months_full": [
36
+ "",
37
+ "Janeiro",
38
+ "Fevereiro",
39
+ "Março",
40
+ "Abril",
41
+ "Maio",
42
+ "Junho",
43
+ "Julho",
44
+ "Agosto",
45
+ "Setembro",
46
+ "Outubro",
47
+ "Novembro",
48
+ "Dezembro"
49
+ ],
50
+ "months_short": [
51
+ "",
52
+ "Jan",
53
+ "Fev",
54
+ "Mar",
55
+ "Abr",
56
+ "Mai",
57
+ "Jun",
58
+ "Jul",
59
+ "Ago",
60
+ "Set",
61
+ "Out",
62
+ "Nov",
63
+ "Dez"
64
+ ]
65
+ },
66
+ "es_ES": {
67
+ "months_full": [
68
+ "",
69
+ "Enero",
70
+ "Febrero",
71
+ "Marzo",
72
+ "Abril",
73
+ "Mayo",
74
+ "Junio",
75
+ "Julio",
76
+ "Augusto",
77
+ "Setiembre",
78
+ "Octubre",
79
+ "Noviembre",
80
+ "Diciembre"
81
+ ],
82
+ "months_short": [
83
+ "",
84
+ "Ene",
85
+ "Feb",
86
+ "Mar",
87
+ "Abr",
88
+ "May",
89
+ "Jun",
90
+ "Jul",
91
+ "Aug",
92
+ "Set",
93
+ "Oct",
94
+ "Nov",
95
+ "Dic"
96
+ ]
97
+ },
98
+ "fr_FR": {
99
+ "months_full": [
100
+ "",
101
+ "Janvier",
102
+ "Février",
103
+ "Mars",
104
+ "Avril",
105
+ "Mai",
106
+ "Juin",
107
+ "Juillet",
108
+ "Août",
109
+ "Septembre",
110
+ "Octobre",
111
+ "Novembre",
112
+ "Décembre"
113
+ ],
114
+ "months_short": [
115
+ "",
116
+ "Jan",
117
+ "Fév",
118
+ "Mar",
119
+ "Avr",
120
+ "Mai",
121
+ "Juin",
122
+ "Juil",
123
+ "Aoû",
124
+ "Sep",
125
+ "Oct",
126
+ "Nov",
127
+ "Déc"
128
+ ]
129
+ },
130
+ "it_IT": {
131
+ "months_full": [
132
+ "",
133
+ "Gennaio",
134
+ "Febbraio",
135
+ "Marzo",
136
+ "Aprile",
137
+ "Maggio",
138
+ "Giugno",
139
+ "Luglio",
140
+ "Agosto",
141
+ "Settembre",
142
+ "Ottobre",
143
+ "Novembre",
144
+ "Dicembre"
145
+ ],
146
+ "months_short": [
147
+ "",
148
+ "Gen",
149
+ "Feb",
150
+ "Mar",
151
+ "Apr",
152
+ "Mag",
153
+ "Giu",
154
+ "LuG",
155
+ "Ago",
156
+ "Set",
157
+ "Ott",
158
+ "Nov",
159
+ "Dic"
160
+ ]
161
+ },
162
+ "de_DE": {
163
+ "months_full": [
164
+ "",
165
+ "Januar",
166
+ "Februar",
167
+ "März",
168
+ "April",
169
+ "Mai",
170
+ "Juni",
171
+ "Juli",
172
+ "August",
173
+ "September",
174
+ "Oktober",
175
+ "November",
176
+ "Dezember"
177
+ ],
178
+ "months_short": [
179
+ "",
180
+ "Jan",
181
+ "Feb",
182
+ "Mär",
183
+ "Apr",
184
+ "Mai",
185
+ "Jun",
186
+ "Jul",
187
+ "Aug",
188
+ "Sep",
189
+ "Okt",
190
+ "Nov",
191
+ "Dez"
192
+ ]
193
+ },
194
+ "ru_RU": {
195
+ "months_full": [
196
+ "",
197
+ "январь",
198
+ "февраль",
199
+ "март",
200
+ "апрель",
201
+ "май",
202
+ "июнь",
203
+ "июль",
204
+ "август",
205
+ "сентябрь",
206
+ "октябрь",
207
+ "ноябрь",
208
+ "декабрь"
209
+ ],
210
+ "months_short": [
211
+ "",
212
+ "янв.",
213
+ "февр.",
214
+ "март",
215
+ "апр.",
216
+ "май",
217
+ "июн.",
218
+ "июл.",
219
+ "авг.",
220
+ "сент.",
221
+ "окт.",
222
+ "нояб.",
223
+ "дек."
224
+ ]
225
+ },
226
+ "jp_JP": {
227
+ "months_full": [
228
+ "",
229
+ "一月",
230
+ "二月",
231
+ "三月",
232
+ "四月",
233
+ "五月",
234
+ "六月",
235
+ "七月",
236
+ "八月",
237
+ "九月",
238
+ "十月",
239
+ "十一月",
240
+ "十二月"
241
+ ],
242
+ "months_short": [
243
+ "",
244
+ "1月",
245
+ "2月",
246
+ "3月",
247
+ "4月",
248
+ "5月",
249
+ "6月",
250
+ "7月",
251
+ "8月",
252
+ "9月",
253
+ "10月",
254
+ "11月",
255
+ "12月"
256
+ ]
257
+ },
258
+ "ch_CH": {
259
+ "months_full": [
260
+ "",
261
+ "一月",
262
+ "二月",
263
+ "三月",
264
+ "四月",
265
+ "五月",
266
+ "六月",
267
+ "七月",
268
+ "八月",
269
+ "九月",
270
+ "十月",
271
+ "十一月",
272
+ "十二月"
273
+ ],
274
+ "months_short": [
275
+ "",
276
+ "一月",
277
+ "二月",
278
+ "三月",
279
+ "四月",
280
+ "五月",
281
+ "六月",
282
+ "七月",
283
+ "八月",
284
+ "九月",
285
+ "十月",
286
+ "十一月",
287
+ "十二月"
288
+ ]
289
+ }
290
+ }
@@ -0,0 +1,101 @@
1
+ # frozen_string_literal: true
2
+ require "json"
3
+ require "date"
4
+ require "jekyll"
5
+
6
+ module Rawfeed
7
+ module Datelang
8
+ class Main < Liquid::Tag
9
+ def initialize(tag_name, text, tokens)
10
+ super
11
+ @markup = text.strip
12
+ end
13
+
14
+ def render(context)
15
+ site = context.registers[:site]
16
+ page = context.registers[:page] || {}
17
+ config = site.config
18
+
19
+ locale = config.dig("datelang", "lang") || "en_US"
20
+
21
+ json_path = File.join(site.source, "assets", "json", "datelang.json")
22
+ json_path = File.expand_path("../../assets/json/datelang.json", __dir__) unless File.exist?(json_path)
23
+
24
+ return "[datelang error: datelang.json not found]" unless File.exist?(json_path)
25
+
26
+ translations = JSON.parse(File.read(json_path))
27
+ data = translations[locale] || translations["en_US"]
28
+
29
+ args = parse_args(@markup, context)
30
+ date_input = args[:date] || page["date"] || page[:date]
31
+ format = args[:format] || "%b %-d, %Y"
32
+
33
+ return "[datelang: no date]" unless date_input && date_input.to_s.strip != ""
34
+
35
+ date = parse_date(date_input)
36
+ return "[datelang: invalid date '#{date_input}']" unless date
37
+
38
+ formatted = date.strftime(format)
39
+ replace_months(formatted, data)
40
+ end
41
+
42
+ private
43
+
44
+ def parse_args(text, context)
45
+ args = {}
46
+
47
+ # captures tokens respecting quoted strings
48
+ tokens = text.scan(/"[^"]*"|\S+/).map { |t| t.strip }
49
+
50
+ tokens.each do |tok|
51
+ if tok.include?(':')
52
+ key, raw_val = tok.split(':', 2)
53
+ # value in quotes -> literal
54
+ if raw_val.start_with?('"') && raw_val.end_with?('"')
55
+ val = raw_val[1..-2]
56
+ else
57
+ # unquoted value -> can be a Liquid variable (e.g., site.date.format)
58
+ # we render "{{ value }}" in the context to get its actual content
59
+ val = Liquid::Template.parse("{{ #{raw_val} }}").render(context).strip
60
+ end
61
+ args[key.to_sym] = val
62
+ else
63
+ # standalone token (e.g: page.date)
64
+ rendered = Liquid::Template.parse("{{ #{tok} }}").render(context).strip
65
+ args[:date] = rendered unless rendered.empty?
66
+ end
67
+ end
68
+
69
+ args
70
+ end
71
+
72
+ def parse_date(input)
73
+ case input
74
+ when Date then input
75
+ when Time then input.to_date
76
+ else
77
+ # if it is string like "2025-10-13 12:34:00 -0300" etc, Date.parse works
78
+ begin
79
+ Date.parse(input.to_s)
80
+ rescue ArgumentError
81
+ nil
82
+ end
83
+ end
84
+ end
85
+
86
+ def replace_months(str, data)
87
+ data["months_full"].each_with_index do |m, i|
88
+ next if i.zero?
89
+ str = str.gsub(Date::MONTHNAMES[i], m)
90
+ end
91
+ data["months_short"].each_with_index do |m, i|
92
+ next if i.zero?
93
+ str = str.gsub(Date::ABBR_MONTHNAMES[i], m)
94
+ end
95
+ str
96
+ end
97
+ end
98
+ end
99
+ end
100
+
101
+ Liquid::Template.register_tag("datelang", Rawfeed::Datelang::Main)
data/lib/rawfeed/draft.rb CHANGED
@@ -16,7 +16,7 @@ module Rawfeed
16
16
  file.puts("title: \"#{array[0]}\"")
17
17
  file.puts("description: \"Description of your post\"")
18
18
  file.puts("author: \"Your Name\"")
19
- file.puts("date: #{array[2]}")
19
+ file.puts("date: #{array[2]} -0300")
20
20
  file.puts("update_date: ")
21
21
  file.puts("comments: false")
22
22
  file.puts("tags: [tag1, tag2]")
data/lib/rawfeed/page.rb CHANGED
@@ -17,8 +17,9 @@ module Rawfeed
17
17
  file.puts("order: #number")
18
18
  file.puts("title: \"#{array[0]}\"")
19
19
  file.puts("author: \"Your Name\"")
20
- file.puts("date: #{array[2]}")
20
+ file.puts("date: #{array[2]} -0300")
21
21
  file.puts("update_date: ")
22
+ file.puts("reading_time: true")
22
23
  file.puts("published: false")
23
24
  file.puts("permalink: /#{permalink}/")
24
25
  file.puts("---")
@@ -0,0 +1,17 @@
1
+ require "jekyll"
2
+
3
+ module Rawfeed
4
+ module ReadingTimeFilter
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"]
10
+ words = input.split.size;
11
+ minutes = ( words / words_per_minute ).floor
12
+ minutes_label = minutes == 1 ? "#{minutes_text[0]}" : "#{minutes_text[1]}"
13
+ minutes > 0 ? "#{message[0]} #{minutes} #{minutes_label}" : "#{message[1]} 1 #{minutes_text[0]}"
14
+ end
15
+ end
16
+ end
17
+ Liquid::Template.register_filter(Rawfeed::ReadingTimeFilter)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rawfeed
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/rawfeed.rb CHANGED
@@ -1,6 +1,11 @@
1
+ # frozen_string_literal: true
2
+ # author: William C. Canin
3
+
1
4
  require_relative "rawfeed/version"
2
5
  require_relative "rawfeed/draft"
3
6
  require_relative "rawfeed/post"
4
7
  require_relative "rawfeed/page"
5
8
  require_relative "rawfeed/resume"
6
9
  require_relative "rawfeed/layout"
10
+ require "rawfeed/datelang"
11
+ require "rawfeed/reading_time"
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.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William C. Canin
@@ -205,11 +205,11 @@ files:
205
205
  - assets/images/avatar_light.png
206
206
  - assets/images/favicon.png
207
207
  - assets/js/avatar.js
208
- - assets/js/blog_search.js
209
208
  - assets/js/default.js
210
209
  - assets/js/terminal.js
211
210
  - assets/js/toc.js
212
211
  - assets/json/blog_search.json
212
+ - assets/json/datelang.json
213
213
  - assets/vendor/bootstrap/css/bootstrap-grid.css
214
214
  - assets/vendor/bootstrap/css/bootstrap-grid.css.map
215
215
  - assets/vendor/bootstrap/css/bootstrap-grid.min.css
@@ -257,11 +257,13 @@ files:
257
257
  - assets/vendor/simple-jekyll-search.js
258
258
  - assets/vendor/simple-jekyll-search.min.js
259
259
  - lib/rawfeed.rb
260
+ - lib/rawfeed/datelang.rb
260
261
  - lib/rawfeed/draft.rb
261
262
  - lib/rawfeed/installer.rb
262
263
  - lib/rawfeed/layout.rb
263
264
  - lib/rawfeed/page.rb
264
265
  - lib/rawfeed/post.rb
266
+ - lib/rawfeed/reading_time.rb
265
267
  - lib/rawfeed/resume.rb
266
268
  - lib/rawfeed/utils.rb
267
269
  - lib/rawfeed/version.rb