whiteblog-theme 0.5.0 → 0.6.0

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: c5e08ffe1dcb3bcc2fdeebfeb6c74b7140b20d58f284bc361c4fe081f35b6875
4
- data.tar.gz: '0202736924aad8cc484232337cc96841e4a1bc40dd352eadf7f328ed2b45eff6'
3
+ metadata.gz: 8bb9778cc4df1a3cfebd3d45da3877c61e63048b29bd1b90b28a411a9c00dbf8
4
+ data.tar.gz: 84a6bec28a82cc83638dc1ee4a6c72cfb277611cce4b9b671e61d218d175c873
5
5
  SHA512:
6
- metadata.gz: 9b91bccd52c09bc85accee9dd569fcd92d8f3b06dad265989ffb4546bdb9097a1db5ea491c6677965442495691edc1ba8495de7edad3350816be1fb9a4a72994
7
- data.tar.gz: 2ce8686257fc699d8cd0606c2ee0aed53d473a4caa28a7c044749da44fd867dbacbdd5e66f9d87e39201253da3e2091dbc00bb3e84a8bbe74d744685abbc91be
6
+ metadata.gz: 157ba201750be2c69830326d5d7ce931c45d62945169bb3916092676a119bfb42f7be09125434d896c066b01ab1abf34809423baeadde17d03ce5c71e549d054
7
+ data.tar.gz: 15338014bb336818fc50485303f8997270a8dc55a2c0503565a06bc9fdd7e7faaccf815e646937bbac100efd58572a5ff92eca22826a6af12d9cc66dcabebdce
data/README.md CHANGED
@@ -23,12 +23,15 @@ estimates, and pluggable comment providers.
23
23
  - **Search** — client-side search over a generated `search.json`
24
24
  (SimpleJekyllSearch, no external service).
25
25
  - **Categories** — category index and per-category listing.
26
+ - **Related posts** — end-of-post section matched by shared category,
27
+ falling back to the most recent posts when there's no category overlap.
26
28
  - **Post previews** — `_plugins/previews.rb` renders a social PNG per post
27
29
  (see [Post preview plugin](#post-preview-plugin) for system requirements).
28
30
  - **SEO** — meta description, Open Graph and Twitter tags, and JSON-LD
29
31
  `BlogPosting`, all derived from the post excerpt.
30
32
  - **Accessibility** — skip link, ARIA labels, accessible pagination,
31
33
  keyboard-dismissable mobile nav, WCAG AA contrast.
34
+ - **Callouts** — Obsidian-style `> [!note]` blocks (see [Callouts](#callouts)).
32
35
  - **Comments** — Disqus, Cusdis or Giscus, selected in `_config.yml`.
33
36
  - **Analytics** — optional Google Analytics 4.
34
37
 
@@ -77,6 +80,9 @@ addons:
77
80
  back_to_top : true # back-to-top button
78
81
  share_post : true # share buttons on posts
79
82
  old_post_warning : false # banner on old posts
83
+ related_posts:
84
+ enabled : true # related posts section at the end of a post
85
+ limit : 3 # max related posts to show
80
86
  buymeacoffee:
81
87
  id : "" # buymeacoffee username; empty disables the widget
82
88
  description : "Support me on Buy me a coffee!"
@@ -155,30 +161,54 @@ analytics:
155
161
 
156
162
  ## Post preview plugin
157
163
 
158
- `_plugins/previews.rb` generates one PNG per post via the `imgkit` gem, which
159
- shells out to **wkhtmltoimage**. If `pngquant` is on `PATH` the PNG is
160
- compressed in place. Both are external system binaries — install them before
161
- building:
164
+ `_plugins/previews.rb` renders a 1200×630 PNG per post (used as `og:image` and
165
+ `twitter:image`) with **headless Chrome or Chromium**, styled by
166
+ `assets/css/previews.css`. No gems are needed. The plugin looks for Chrome,
167
+ Chromium or Edge in the usual install locations and on `PATH`; set
168
+ `WHITEBLOG_CHROME` to use a specific binary. If none is found, previews are
169
+ skipped with a warning and the build continues.
170
+
171
+ Existing PNGs are never overwritten: delete one from `assets/images/previews/`
172
+ to regenerate it. If `pngquant` is on `PATH` the PNG is compressed in place.
162
173
 
163
174
  ```bash
164
175
  # macOS
165
- brew install --cask wkhtmltopdf # provides wkhtmltoimage
166
- brew install pngquant # optional, for compression
176
+ brew install pngquant # optional, for compression
167
177
 
168
178
  # Debian / Ubuntu
169
- apt-get install wkhtmltopdf pngquant
179
+ apt-get install chromium pngquant
170
180
  ```
171
181
 
172
- Add the gem to your site's `Gemfile`:
182
+ GitHub Pages runs in `--safe` mode and will not execute this plugin; build and
183
+ deploy the `_site` output yourself if you need previews.
173
184
 
174
- ```ruby
175
- group :jekyll_plugins do
176
- gem "imgkit"
177
- end
185
+ ## Callouts
186
+
187
+ `_plugins/callouts.rb` turns Obsidian-style callouts into styled blocks at build
188
+ time, so posts written in Obsidian render the same on the blog. GitHub alerts
189
+ (`> [!WARNING]`) work too, since the type is case-insensitive.
190
+
191
+ ```markdown
192
+ > [!tip] Optional custom title
193
+ > Callout body. **Markdown** works as usual.
194
+ >
195
+ > Multiple paragraphs too.
178
196
  ```
179
197
 
180
- GitHub Pages runs in `--safe` mode and will not execute this plugin; build and
181
- deploy the `_site` output yourself if you need previews.
198
+ | Variant | Types |
199
+ |---------|-------|
200
+ | note | `note`, `info`, `abstract`, `summary`, `tldr`, `todo`, `question`, `faq`, `example`, `quote` |
201
+ | tip | `tip`, `hint`, `important`, `success`, `done` |
202
+ | warning | `warning`, `caution`, `attention` |
203
+ | danger | `danger`, `error`, `failure`, `bug` |
204
+
205
+ Without a title, a default one is used (`Nota`, `Tip`, `Advertencia`, ...).
206
+ Unknown types render as `note` with the type as title. The foldable markers
207
+ (`[!note]+` / `[!note]-`) are accepted but the callout is always expanded.
208
+
209
+ Jekyll does not load plugins from a gem theme: copy `_plugins/callouts.rb` into
210
+ your site's `_plugins/` folder. Like any custom plugin, it does not run on
211
+ GitHub Pages' `--safe` build.
182
212
 
183
213
  ## Development
184
214
 
data/_includes/head.html CHANGED
@@ -1,8 +1,8 @@
1
1
  <head>
2
2
  <meta charset="utf-8">
3
3
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
4
- <meta name="theme-color" media="(prefers-color-scheme: light)" content="#F5F5F5">
5
- <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#25242f">
4
+ <meta name="theme-color" media="(prefers-color-scheme: light)" content="#FAF9FD">
5
+ <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#25242F">
6
6
 
7
7
  <title>{% if page.title %}{{ page.title }} | {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
8
8
  <link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">
@@ -37,7 +37,7 @@
37
37
 
38
38
  <link rel="preconnect" href="https://fonts.googleapis.com">
39
39
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
40
- <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Space+Grotesk:wght@300..700&display=swap">
40
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400;500&display=swap">
41
41
  <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
42
42
  <link rel="alternate" type="application/rss+xml" title="{{ site.title | escape }}" href="{{ "/feed.xml" | relative_url }}">
43
43
  <link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">
@@ -0,0 +1,65 @@
1
+ {% comment %}
2
+ Related posts by shared category, most relevant first.
3
+ Falls back to most recent posts when the current post has no
4
+ category match with any other post.
5
+ Config: site.addons.related_posts.enabled (bool), .limit (int, default 3)
6
+ {% endcomment %}
7
+ {% assign max_related = site.addons.related_posts.limit | default: 3 %}
8
+ {% assign date_format = site.theme.date_format | default: "%b %-d, %Y" %}
9
+ {% assign max_shared = 0 %}
10
+
11
+ {% for post in site.posts %}
12
+ {% if post.url != page.url %}
13
+ {% assign shared = 0 %}
14
+ {% for category in post.categories %}
15
+ {% if page.categories contains category %}
16
+ {% assign shared = shared | plus: 1 %}
17
+ {% endif %}
18
+ {% endfor %}
19
+ {% if shared > max_shared %}
20
+ {% assign max_shared = shared %}
21
+ {% endif %}
22
+ {% endif %}
23
+ {% endfor %}
24
+
25
+ {% assign min_shared = 1 %}
26
+ {% if max_shared == 0 %}
27
+ {% assign min_shared = 0 %}
28
+ {% endif %}
29
+
30
+ {% assign related_count = 0 %}
31
+ {% capture related_html %}
32
+ {% for shared_target in (min_shared..max_shared) reversed %}
33
+ {% for post in site.posts %}
34
+ {% if related_count >= max_related %}{% break %}{% endif %}
35
+ {% if post.url != page.url %}
36
+ {% assign shared = 0 %}
37
+ {% for category in post.categories %}
38
+ {% if page.categories contains category %}
39
+ {% assign shared = shared | plus: 1 %}
40
+ {% endif %}
41
+ {% endfor %}
42
+ {% if shared == shared_target %}
43
+ {% assign related_count = related_count | plus: 1 %}
44
+ <li class="post-resume">
45
+ <h3 class="post-resume-title">
46
+ <a href="{{ post.url | relative_url }}">
47
+ <span class="underline">{{ post.title | escape }}</span>
48
+ </a>
49
+ </h3>
50
+ <span class="text-secondary">{{ post.date | date: date_format }}</span>
51
+ </li>
52
+ {% endif %}
53
+ {% endif %}
54
+ {% endfor %}
55
+ {% endfor %}
56
+ {% endcapture %}
57
+
58
+ {% if related_count > 0 %}
59
+ <section class="related-posts" aria-labelledby="related-posts-heading">
60
+ <h2 id="related-posts-heading">Posts relacionados</h2>
61
+ <ul>
62
+ {{ related_html }}
63
+ </ul>
64
+ </section>
65
+ {% endif %}
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  (function() {
3
- const saved = localStorage.getItem('whiteblog-theme');
3
+ let saved = null;
4
+ try { saved = localStorage.getItem('whiteblog-theme'); } catch (e) {}
4
5
  const theme = saved || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
5
6
  document.documentElement.setAttribute('data-theme', theme);
6
7
  })();
data/_layouts/post.html CHANGED
@@ -87,6 +87,10 @@ layout: default
87
87
  {{ content }}
88
88
  </div>
89
89
 
90
+ {% if site.addons.related_posts.enabled %}
91
+ {% include related-posts.html %}
92
+ {% endif %}
93
+
90
94
  <div class="row">
91
95
  {% if site.comments.provider%}
92
96
  {% include comments.html %}
@@ -1,40 +1,51 @@
1
1
  :root {
2
- --color-bg: #F5F5F5;
3
- --color-accent: #17E9E0;
4
- --color-primary: #923DB5;
5
- --color-text: #212529;
6
- --color-dark: #313638;
7
- --color-highlight: #25E498;
8
- --color-code: #C01979;
9
- --color-code-bg: #282a36;
10
- --color-notice: #CFBAE1;
2
+ --color-bg: #FAF9FD;
3
+ --color-accent: #C7B2FA;
4
+ --color-primary: #6B38D4;
5
+ --color-text: #1A1726;
6
+ --color-dark: #6A6580;
7
+ --color-highlight: #C7B2FA;
8
+ --color-code: #6B38D4;
9
+ --color-code-bg: #1E1B2B;
10
+ --color-notice: #E3DEF0;
11
11
  --color-success: #28a745;
12
- --color-blockquote: #F39237;
12
+ --color-blockquote: #6B38D4;
13
13
  --color-warning-bg: #fff3cd;
14
14
  --color-warning-text: #856404;
15
15
  --color-warning-border: #ffeaa7;
16
16
  --color-warning-icon: #ffc107;
17
- --font-main: 'Space Grotesk', system-ui, -apple-system, sans-serif;
18
- --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
17
+ --color-danger: #dc3545;
18
+ --font-main: 'Geist', system-ui, -apple-system, sans-serif;
19
+ --font-heading: 'Geist', system-ui, -apple-system, sans-serif;
20
+ --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
21
+ --syn-text: #E9E7F1;
22
+ --syn-comment: #7C7893;
23
+ --syn-keyword: #BFA2FF;
24
+ --syn-operator: #F08DB8;
25
+ --syn-string: #F5C98A;
26
+ --syn-number: #F2A98A;
27
+ --syn-function: #8FD3FF;
28
+ --syn-added: #A6D9A0;
19
29
  --container-width: 90%;
20
30
  --transition-default: all 0.3s ease-in-out;
21
31
  }
22
32
 
23
33
  [data-theme="dark"] {
24
- --color-bg: #1a1a2e;
25
- --color-accent: #44318D;
26
- --color-primary: #CE80EF;
27
- --color-text: #E8E8E8;
28
- --color-dark: #CCCCCC;
29
- --color-highlight: #D83F87;
30
- --color-code: #e0aaff;
31
- --color-code-bg: #282a36;
32
- --color-notice: #4A3B5C;
33
- --color-blockquote: #F39237;
34
+ --color-bg: #25242F;
35
+ --color-accent: #4C2FA0;
36
+ --color-primary: #B794FF;
37
+ --color-text: #EEEBFA;
38
+ --color-dark: #9590AD;
39
+ --color-highlight: #4C2FA0;
40
+ --color-code: #B794FF;
41
+ --color-code-bg: #191724;
42
+ --color-notice: #403D52;
43
+ --color-blockquote: #B794FF;
34
44
  --color-warning-bg: #3a2e10;
35
45
  --color-warning-text: #f0c040;
36
46
  --color-warning-border: #5a4820;
37
47
  --color-warning-icon: #f0c040;
48
+ --color-danger: #ff6b6b;
38
49
  }
39
50
 
40
51
  .sr-only {
@@ -90,6 +101,8 @@ body {
90
101
  min-height: 100vh;
91
102
  position: relative;
92
103
  overflow-y: scroll;
104
+ display: flex;
105
+ flex-direction: column;
93
106
  }
94
107
 
95
108
  h1, h2, h3, h4, h5, h6 {
@@ -295,6 +308,7 @@ a#blog-title:focus-visible::before {
295
308
  .navbar-toggler {
296
309
  border: none;
297
310
  background: transparent;
311
+ color: var(--color-text);
298
312
  cursor: pointer;
299
313
  padding: 0.5rem;
300
314
  display: none;
@@ -383,6 +397,27 @@ a#blog-title:focus-visible::before {
383
397
  }
384
398
  }
385
399
 
400
+ .related-posts {
401
+ margin-top: 3rem;
402
+ padding-top: 2rem;
403
+ border-top: 1px solid var(--color-notice);
404
+
405
+ h2 {
406
+ font-size: 1.25rem;
407
+ margin-bottom: 0.5rem;
408
+ }
409
+
410
+ ul {
411
+ list-style: none;
412
+ padding-left: 0;
413
+ margin: 0;
414
+ }
415
+
416
+ .post-resume-title {
417
+ font-size: 1.25rem;
418
+ }
419
+ }
420
+
386
421
  .nav-list {
387
422
  display: flex;
388
423
  align-items: center;
@@ -505,6 +540,11 @@ p {
505
540
  }
506
541
  }
507
542
 
543
+ .row .link,
544
+ .row .link * {
545
+ color: var(--color-text);
546
+ }
547
+
508
548
  .next {
509
549
  text-align: right;
510
550
  }
@@ -538,7 +578,7 @@ p {
538
578
 
539
579
  code {
540
580
  font-size: .9em;
541
- font-family: 'Fira Code', monospace;
581
+ font-family: var(--font-mono);
542
582
  color: var(--color-code);
543
583
  word-wrap: break-word;
544
584
  }
@@ -560,6 +600,46 @@ blockquote p {
560
600
  margin-bottom: 0;
561
601
  }
562
602
 
603
+ blockquote.callout {
604
+ --callout-color: var(--color-primary);
605
+ display: block;
606
+ width: auto;
607
+ margin: 1.5rem 0;
608
+ padding: 0.75rem 1rem;
609
+ border: 0;
610
+ border-left: 4px solid var(--callout-color);
611
+ border-radius: 0.25rem;
612
+ background-color: color-mix(in srgb, var(--callout-color) 10%, transparent);
613
+ font-style: normal;
614
+ font-weight: 400;
615
+ font-size: 1rem;
616
+ }
617
+
618
+ blockquote.callout p + p {
619
+ margin-top: 0.5rem;
620
+ }
621
+
622
+ blockquote.callout .callout-title {
623
+ color: var(--callout-color);
624
+ font-weight: 700;
625
+ }
626
+
627
+ blockquote.callout-tip {
628
+ --callout-color: var(--color-success);
629
+ }
630
+
631
+ blockquote.callout-warning {
632
+ --callout-color: var(--color-warning-icon);
633
+ }
634
+
635
+ blockquote.callout-warning .callout-title {
636
+ color: var(--color-warning-text);
637
+ }
638
+
639
+ blockquote.callout-danger {
640
+ --callout-color: var(--color-danger);
641
+ }
642
+
563
643
  .highlight {
564
644
  margin: 1.3rem 0;
565
645
  }
@@ -569,10 +649,15 @@ blockquote p {
569
649
  padding: 1rem 1rem;
570
650
  overflow: auto;
571
651
  background-color: var(--color-code-bg);
652
+ color: var(--syn-text);
572
653
  white-space: pre-wrap;
573
654
  min-width: 100%;
574
655
  }
575
656
 
657
+ .highlight pre code {
658
+ color: inherit;
659
+ }
660
+
576
661
  .highlight pre button,
577
662
  .copy-btn {
578
663
  position: absolute;
@@ -582,11 +667,12 @@ blockquote p {
582
667
  border: none;
583
668
  cursor: pointer;
584
669
  padding: 0.25rem;
670
+ color: var(--syn-text);
585
671
  }
586
672
 
587
673
  .highlight pre button.copy-success {
588
674
  background-color: var(--color-success);
589
- color: white;
675
+ color: var(--color-bg);
590
676
  border-radius: 4px;
591
677
  }
592
678
 
@@ -613,10 +699,8 @@ ul {
613
699
  }
614
700
 
615
701
  #site-footer {
616
- position: absolute;
617
- bottom: 0;
618
702
  width: 100%;
619
- height: 4rem;
703
+ min-height: 4rem;
620
704
  color: var(--color-text);
621
705
  background-color: var(--color-bg);
622
706
  }
@@ -652,7 +736,7 @@ svg {
652
736
 
653
737
  .ascii-404 {
654
738
  display: inline-block;
655
- font-family: 'Fira Code', monospace;
739
+ font-family: var(--font-mono);
656
740
  color: var(--color-code);
657
741
  white-space: pre;
658
742
  text-align: left;
@@ -770,7 +854,7 @@ svg {
770
854
  top: 50%;
771
855
  left: 50%;
772
856
  transform: translate(-50%, -50%);
773
- color: white;
857
+ color: var(--color-bg);
774
858
  font-size: 9px;
775
859
  font-weight: bold;
776
860
  }
@@ -811,7 +895,7 @@ svg {
811
895
 
812
896
  .divider {
813
897
  background: var(--color-primary);
814
- height: 4px;
898
+ height: 2px;
815
899
  margin: 0 auto;
816
900
  max-width: var(--container-width);
817
901
  opacity: 1;
@@ -867,7 +951,7 @@ svg {
867
951
 
868
952
  .pagination a.current {
869
953
  background: var(--color-primary);
870
- color: white;
954
+ color: var(--color-bg);
871
955
  }
872
956
 
873
957
  .pagination a.disabled {
@@ -893,7 +977,7 @@ svg {
893
977
 
894
978
  &.current {
895
979
  background: var(--color-primary);
896
- color: white;
980
+ color: var(--color-bg);
897
981
  }
898
982
  }
899
983
 
@@ -962,7 +1046,7 @@ svg {
962
1046
  width: 100%;
963
1047
  text-align: center;
964
1048
  padding: 0.5rem 0;
965
- border-bottom: 1px solid #ccc;
1049
+ border-bottom: 1px solid var(--color-notice);
966
1050
  a {
967
1051
  display: block;
968
1052
  }
@@ -1,65 +1,65 @@
1
1
  .highlight {
2
- pre { background-color: #272822; }
3
- .hll { background-color: #272822; }
4
- .c { color: #75715e } /* Comment */
5
- .err { color: #960050; background-color: #1e0010 } /* Error */
6
- .k { color: #66d9ef } /* Keyword */
7
- .l { color: #ae81ff } /* Literal */
8
- .n { color: #f8f8f2 } /* Name */
9
- .o { color: #f92672 } /* Operator */
10
- .p { color: #f8f8f2 } /* Punctuation */
11
- .cm { color: #75715e } /* Comment.Multiline */
12
- .cp { color: #75715e } /* Comment.Preproc */
13
- .c1 { color: #75715e } /* Comment.Single */
14
- .cs { color: #75715e } /* Comment.Special */
2
+ pre { background-color: var(--color-code-bg); }
3
+ .hll { background-color: var(--color-code-bg); }
4
+ .c { color: var(--syn-comment) } /* Comment */
5
+ .err { color: var(--color-danger) } /* Error */
6
+ .k { color: var(--syn-keyword) } /* Keyword */
7
+ .l { color: var(--syn-number) } /* Literal */
8
+ .n { color: var(--syn-text) } /* Name */
9
+ .o { color: var(--syn-operator) } /* Operator */
10
+ .p { color: var(--syn-text) } /* Punctuation */
11
+ .cm { color: var(--syn-comment) } /* Comment.Multiline */
12
+ .cp { color: var(--syn-comment) } /* Comment.Preproc */
13
+ .c1 { color: var(--syn-comment) } /* Comment.Single */
14
+ .cs { color: var(--syn-comment) } /* Comment.Special */
15
15
  .ge { font-style: italic } /* Generic.Emph */
16
16
  .gs { font-weight: bold } /* Generic.Strong */
17
- .kc { color: #66d9ef } /* Keyword.Constant */
18
- .kd { color: #66d9ef } /* Keyword.Declaration */
19
- .kn { color: #f92672 } /* Keyword.Namespace */
20
- .kp { color: #66d9ef } /* Keyword.Pseudo */
21
- .kr { color: #66d9ef } /* Keyword.Reserved */
22
- .kt { color: #66d9ef } /* Keyword.Type */
23
- .ld { color: #e6db74 } /* Literal.Date */
24
- .m { color: #ae81ff } /* Literal.Number */
25
- .s { color: #e6db74 } /* Literal.String */
26
- .na { color: #a6e22e } /* Name.Attribute */
27
- .nb { color: #f8f8f2 } /* Name.Builtin */
28
- .nc { color: #a6e22e } /* Name.Class */
29
- .no { color: #66d9ef } /* Name.Constant */
30
- .nd { color: #a6e22e } /* Name.Decorator */
31
- .ni { color: #f8f8f2 } /* Name.Entity */
32
- .ne { color: #a6e22e } /* Name.Exception */
33
- .nf { color: #a6e22e } /* Name.Function */
34
- .nl { color: #f8f8f2 } /* Name.Label */
35
- .nn { color: #f8f8f2 } /* Name.Namespace */
36
- .nx { color: #a6e22e } /* Name.Other */
37
- .py { color: #f8f8f2 } /* Name.Property */
38
- .nt { color: #f92672 } /* Name.Tag */
39
- .nv { color: #f8f8f2 } /* Name.Variable */
40
- .ow { color: #f92672 } /* Operator.Word */
41
- .w { color: #f8f8f2 } /* Text.Whitespace */
42
- .mf { color: #ae81ff } /* Literal.Number.Float */
43
- .mh { color: #ae81ff } /* Literal.Number.Hex */
44
- .mi { color: #ae81ff } /* Literal.Number.Integer */
45
- .mo { color: #ae81ff } /* Literal.Number.Oct */
46
- .sb { color: #e6db74 } /* Literal.String.Backtick */
47
- .sc { color: #e6db74 } /* Literal.String.Char */
48
- .sd { color: #e6db74 } /* Literal.String.Doc */
49
- .s2 { color: #e6db74 } /* Literal.String.Double */
50
- .se { color: #ae81ff } /* Literal.String.Escape */
51
- .sh { color: #e6db74 } /* Literal.String.Heredoc */
52
- .si { color: #e6db74 } /* Literal.String.Interpol */
53
- .sx { color: #e6db74 } /* Literal.String.Other */
54
- .sr { color: #e6db74 } /* Literal.String.Regex */
55
- .s1 { color: #e6db74 } /* Literal.String.Single */
56
- .ss { color: #e6db74 } /* Literal.String.Symbol */
57
- .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
58
- .vc { color: #f8f8f2 } /* Name.Variable.Class */
59
- .vg { color: #f8f8f2 } /* Name.Variable.Global */
60
- .vi { color: #f8f8f2 } /* Name.Variable.Instance */
61
- .il { color: #ae81ff } /* Literal.Number.Integer.Long */
62
- .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */
63
- .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */
64
- .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */
17
+ .kc { color: var(--syn-keyword) } /* Keyword.Constant */
18
+ .kd { color: var(--syn-keyword) } /* Keyword.Declaration */
19
+ .kn { color: var(--syn-operator) } /* Keyword.Namespace */
20
+ .kp { color: var(--syn-keyword) } /* Keyword.Pseudo */
21
+ .kr { color: var(--syn-keyword) } /* Keyword.Reserved */
22
+ .kt { color: var(--syn-keyword) } /* Keyword.Type */
23
+ .ld { color: var(--syn-string) } /* Literal.Date */
24
+ .m { color: var(--syn-number) } /* Literal.Number */
25
+ .s { color: var(--syn-string) } /* Literal.String */
26
+ .na { color: var(--syn-function) } /* Name.Attribute */
27
+ .nb { color: var(--syn-text) } /* Name.Builtin */
28
+ .nc { color: var(--syn-function) } /* Name.Class */
29
+ .no { color: var(--syn-keyword) } /* Name.Constant */
30
+ .nd { color: var(--syn-function) } /* Name.Decorator */
31
+ .ni { color: var(--syn-text) } /* Name.Entity */
32
+ .ne { color: var(--syn-function) } /* Name.Exception */
33
+ .nf { color: var(--syn-function) } /* Name.Function */
34
+ .nl { color: var(--syn-text) } /* Name.Label */
35
+ .nn { color: var(--syn-text) } /* Name.Namespace */
36
+ .nx { color: var(--syn-function) } /* Name.Other */
37
+ .py { color: var(--syn-text) } /* Name.Property */
38
+ .nt { color: var(--syn-operator) } /* Name.Tag */
39
+ .nv { color: var(--syn-text) } /* Name.Variable */
40
+ .ow { color: var(--syn-operator) } /* Operator.Word */
41
+ .w { color: var(--syn-text) } /* Text.Whitespace */
42
+ .mf { color: var(--syn-number) } /* Literal.Number.Float */
43
+ .mh { color: var(--syn-number) } /* Literal.Number.Hex */
44
+ .mi { color: var(--syn-number) } /* Literal.Number.Integer */
45
+ .mo { color: var(--syn-number) } /* Literal.Number.Oct */
46
+ .sb { color: var(--syn-string) } /* Literal.String.Backtick */
47
+ .sc { color: var(--syn-string) } /* Literal.String.Char */
48
+ .sd { color: var(--syn-string) } /* Literal.String.Doc */
49
+ .s2 { color: var(--syn-string) } /* Literal.String.Double */
50
+ .se { color: var(--syn-number) } /* Literal.String.Escape */
51
+ .sh { color: var(--syn-string) } /* Literal.String.Heredoc */
52
+ .si { color: var(--syn-string) } /* Literal.String.Interpol */
53
+ .sx { color: var(--syn-string) } /* Literal.String.Other */
54
+ .sr { color: var(--syn-string) } /* Literal.String.Regex */
55
+ .s1 { color: var(--syn-string) } /* Literal.String.Single */
56
+ .ss { color: var(--syn-string) } /* Literal.String.Symbol */
57
+ .bp { color: var(--syn-text) } /* Name.Builtin.Pseudo */
58
+ .vc { color: var(--syn-text) } /* Name.Variable.Class */
59
+ .vg { color: var(--syn-text) } /* Name.Variable.Global */
60
+ .vi { color: var(--syn-text) } /* Name.Variable.Instance */
61
+ .il { color: var(--syn-number) } /* Literal.Number.Integer.Long */
62
+ .gu { color: var(--syn-comment); } /* Generic.Subheading & Diff Unified/Comment? */
63
+ .gd { color: var(--syn-operator); } /* Generic.Deleted & Diff Deleted */
64
+ .gi { color: var(--syn-added); } /* Generic.Inserted & Diff Inserted */
65
65
  }
@@ -1,44 +1,75 @@
1
- html {
2
- font-size: 16px;
3
- }
4
-
5
- body {
6
- /* background: #614bc3; */
7
- background: rgb(97,75,195);
8
- background: linear-gradient(40deg, rgba(97,75,195,1) 15%, rgba(68,205,213,1) 85%);
9
- background: -webkit-linear-gradient(40deg, rgba(97,75,195,1) 15%, rgba(68,205,213,1) 85%);
10
- width: 600px;
11
- height: 330px;
12
- position: relative;
13
- margin: 0;
14
- }
15
-
16
- .box {
17
- background-color: #fff;
18
- color: #000;
19
- font-family: 'Space Grotesk';
20
- padding: 25px;
21
- margin: 20px;
22
- height: 240px;
23
- position: relative;
24
- }
25
-
26
- .title {
27
- position: absolute;
28
- top: 50px;
29
- max-width: 500px;
30
- > h2 {
31
- margin: 0;
32
- font-size: 42px;
33
- }
34
- }
35
-
36
- .footer {
37
- position: absolute;
38
- bottom: 50px;
39
- max-width: 500px;
40
- > h3 {
41
- margin: 0;
42
- font-size: 20px;
43
- }
44
- }
1
+ /* Rendered at 600x315 CSS px with device scale factor 2 -> 1200x630 PNG */
2
+ :root {
3
+ --preview-bg: #FAF9FD;
4
+ --preview-text: #1A1726;
5
+ --preview-muted: #6A6580;
6
+ --preview-primary: #6B38D4;
7
+ --preview-accent: #B794FF;
8
+ }
9
+
10
+ * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ html,
15
+ body {
16
+ margin: 0;
17
+ width: 600px;
18
+ height: 315px;
19
+ overflow: hidden;
20
+ }
21
+
22
+ body {
23
+ background: linear-gradient(40deg, var(--preview-primary) 15%, var(--preview-accent) 85%);
24
+ padding: 18px;
25
+ font-family: 'Geist', 'Helvetica Neue', Arial, sans-serif;
26
+ }
27
+
28
+ .box {
29
+ height: 100%;
30
+ background-color: var(--preview-bg);
31
+ color: var(--preview-text);
32
+ padding: 32px 36px 26px;
33
+ display: flex;
34
+ flex-direction: column;
35
+ justify-content: space-between;
36
+ }
37
+
38
+ .title {
39
+ margin: 0;
40
+ font-size: 34px;
41
+ font-weight: 600;
42
+ line-height: 1.15;
43
+ letter-spacing: -0.02em;
44
+ display: -webkit-box;
45
+ -webkit-box-orient: vertical;
46
+ -webkit-line-clamp: 4;
47
+ overflow: hidden;
48
+ }
49
+
50
+ .title .hash {
51
+ color: var(--preview-primary);
52
+ font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
53
+ font-weight: 500;
54
+ }
55
+
56
+ .footer {
57
+ display: flex;
58
+ justify-content: space-between;
59
+ align-items: baseline;
60
+ gap: 16px;
61
+ font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
62
+ font-size: 14px;
63
+ color: var(--preview-muted);
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .footer .author {
68
+ color: var(--preview-text);
69
+ font-weight: 500;
70
+ }
71
+
72
+ .footer .site {
73
+ overflow: hidden;
74
+ text-overflow: ellipsis;
75
+ }
Binary file
Binary file
data/assets/js/main.js CHANGED
@@ -1,4 +1,4 @@
1
- const copyButtonSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#FAFAFA" class="bi bi-copy" viewBox="0 0 16 16">
1
+ const copyButtonSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">
2
2
  <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"/>
3
3
  </svg>`;
4
4
 
@@ -6,8 +6,12 @@
6
6
  const LIGHT_THEME = 'light';
7
7
  const DARK_THEME = 'dark';
8
8
 
9
+ function getSavedTheme() {
10
+ try { return localStorage.getItem(THEME_KEY); } catch (e) { return null; }
11
+ }
12
+
9
13
  function getThemePreference() {
10
- const saved = localStorage.getItem(THEME_KEY);
14
+ const saved = getSavedTheme();
11
15
  if (saved) return saved;
12
16
 
13
17
  return window.matchMedia('(prefers-color-scheme: dark)').matches
@@ -15,12 +19,24 @@
15
19
  : LIGHT_THEME;
16
20
  }
17
21
 
18
- function applyTheme(theme) {
22
+ function applyTheme(theme, persist) {
19
23
  document.documentElement.setAttribute('data-theme', theme);
20
- localStorage.setItem(THEME_KEY, theme);
21
-
24
+ if (persist) {
25
+ try { localStorage.setItem(THEME_KEY, theme); } catch (e) {}
26
+ }
27
+
28
+ updateThemeColor();
22
29
  updateToggleButton(theme);
23
30
  }
31
+
32
+ function updateThemeColor() {
33
+ const bg = getComputedStyle(document.documentElement)
34
+ .getPropertyValue('--color-bg').trim();
35
+ if (!bg) return;
36
+ document.querySelectorAll('meta[name="theme-color"]').forEach((meta) => {
37
+ meta.setAttribute('content', bg);
38
+ });
39
+ }
24
40
 
25
41
  function updateToggleButton(theme) {
26
42
  const toggle = document.getElementById('theme-toggle');
@@ -38,7 +54,7 @@
38
54
  function toggleTheme() {
39
55
  const current = document.documentElement.getAttribute('data-theme') || LIGHT_THEME;
40
56
  const newTheme = current === LIGHT_THEME ? DARK_THEME : LIGHT_THEME;
41
- applyTheme(newTheme);
57
+ applyTheme(newTheme, true);
42
58
  }
43
59
 
44
60
  function init() {
@@ -52,7 +68,7 @@
52
68
 
53
69
  window.matchMedia('(prefers-color-scheme: dark)')
54
70
  .addEventListener('change', (e) => {
55
- if (!localStorage.getItem(THEME_KEY)) {
71
+ if (!getSavedTheme()) {
56
72
  applyTheme(e.matches ? DARK_THEME : LIGHT_THEME);
57
73
  }
58
74
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whiteblog-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-09 00:00:00.000000000 Z
11
+ date: 2026-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -92,6 +92,7 @@ files:
92
92
  - _includes/gallery
93
93
  - _includes/head.html
94
94
  - _includes/header.html
95
+ - _includes/related-posts.html
95
96
  - _includes/scripts.html
96
97
  - _includes/sharepost.html
97
98
  - _includes/sidebar.html
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  - !ruby/object:Gem::Version
146
147
  version: '0'
147
148
  requirements: []
148
- rubygems_version: 3.2.3
149
+ rubygems_version: 3.4.19
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: Minimal, wide and white blogging theme for Jekyll