whiteblog-theme 0.4.2 → 0.5.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: 45a0326c5e5c35bd0a3bfbc4177297bd6fa1d084e47b282a3181a681a95c2d07
4
- data.tar.gz: 4cc7275d2324d4d843e64fb3ebce99fb5d5291317c602a60b6c9494aadb4b621
3
+ metadata.gz: c5e08ffe1dcb3bcc2fdeebfeb6c74b7140b20d58f284bc361c4fe081f35b6875
4
+ data.tar.gz: '0202736924aad8cc484232337cc96841e4a1bc40dd352eadf7f328ed2b45eff6'
5
5
  SHA512:
6
- metadata.gz: 6d0adb86492d3fa856593e21b9a7f96d8ba00d9482b02761da74df31943bfc13f75886f574893717201a5eafdc34177dc2f15eeb81ac1fe1dcb99d211e737a52
7
- data.tar.gz: 47b049292fb97a82f7aa7529b4b43be25f55be47eb196096910437ca7a28b7cf8b1a654a094d983b6c3c1dfed5054ff161c8fe0f1899cf41f193bb50e6fb5a0c
6
+ metadata.gz: 9b91bccd52c09bc85accee9dd569fcd92d8f3b06dad265989ffb4546bdb9097a1db5ea491c6677965442495691edc1ba8495de7edad3350816be1fb9a4a72994
7
+ data.tar.gz: 2ce8686257fc699d8cd0606c2ee0aed53d473a4caa28a7c044749da44fd867dbacbdd5e66f9d87e39201253da3e2091dbc00bb3e84a8bbe74d744685abbc91be
data/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
4
4
  ![Gem downloads](https://img.shields.io/gem/dt/whiteblog-theme.svg?colorB=brightgreen&style=flat)
5
5
 
6
- Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
7
-
8
- To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!
9
-
6
+ A minimal, wide and white Jekyll theme for technical blogs. Ships with a
7
+ dark/light toggle, category pages, client-side search, automatic PNG preview
8
+ generation for posts, an RSS feed, an automatic sitemap, reading-time
9
+ estimates, and pluggable comment providers.
10
10
 
11
11
  ## Live preview
12
12
 
@@ -14,7 +14,23 @@ To experiment with this code, add some sample content and run `bundle exec jekyl
14
14
 
15
15
  ## Screenshot
16
16
 
17
- ![Screenshot of whiteblog-theme](https://raw.githubusercontent.com/vmsilvamolina/whiteblog-theme/master/screenshot.png)
17
+ ![Screenshot of whiteblog-theme](https://raw.githubusercontent.com/vmsilvamolina/whiteblog-theme/main/screenshot.png)
18
+
19
+ ## Features
20
+
21
+ - **Dark mode** — `[data-theme="dark"]` toggle with `prefers-color-scheme`
22
+ detection and `localStorage` persistence. Colours are CSS variables.
23
+ - **Search** — client-side search over a generated `search.json`
24
+ (SimpleJekyllSearch, no external service).
25
+ - **Categories** — category index and per-category listing.
26
+ - **Post previews** — `_plugins/previews.rb` renders a social PNG per post
27
+ (see [Post preview plugin](#post-preview-plugin) for system requirements).
28
+ - **SEO** — meta description, Open Graph and Twitter tags, and JSON-LD
29
+ `BlogPosting`, all derived from the post excerpt.
30
+ - **Accessibility** — skip link, ARIA labels, accessible pagination,
31
+ keyboard-dismissable mobile nav, WCAG AA contrast.
32
+ - **Comments** — Disqus, Cusdis or Giscus, selected in `_config.yml`.
33
+ - **Analytics** — optional Google Analytics 4.
18
34
 
19
35
  ## Installation
20
36
 
@@ -38,20 +54,155 @@ Or install it yourself as:
38
54
 
39
55
  $ gem install whiteblog-theme
40
56
 
57
+ ## Configuration
41
58
 
42
- ## Contributing
59
+ All configuration lives in `_config.yml`.
60
+
61
+ ### Layouts
62
+
63
+ | Layout | Use |
64
+ |-------------|----------------------------------------|
65
+ | `default` | Base for every other layout |
66
+ | `home` | Paginated index |
67
+ | `post` | Blog entry |
68
+ | `page` | Static page with sidebar |
69
+ | `page-wide` | Static page without sidebar |
70
+ | `allposts` | Full post listing |
71
+ | `categories`| Category view |
72
+
73
+ ### Addons
74
+
75
+ ```yaml
76
+ addons:
77
+ back_to_top : true # back-to-top button
78
+ share_post : true # share buttons on posts
79
+ old_post_warning : false # banner on old posts
80
+ buymeacoffee:
81
+ id : "" # buymeacoffee username; empty disables the widget
82
+ description : "Support me on Buy me a coffee!"
83
+ message : ""
84
+ color : "" # empty uses the theme's --color-accent, or a hex
85
+ position : "left" # left, right
86
+ x_margin : "18" # mobile horizontal margin
87
+ x_margin_desktop : "72" # margin at >= 950px, aligned to the sidebar edge
88
+ y_margin : "18"
89
+ ```
90
+
91
+ ### Comments
92
+
93
+ Set `comments.provider` and fill in the matching block. Any other blocks are
94
+ ignored.
95
+
96
+ ```yaml
97
+ comments:
98
+ provider : false # false, "disqus", "cusdis", "giscus"
99
+ ```
100
+
101
+ **Disqus** — create a site at [disqus.com](https://disqus.com/), then:
102
+
103
+ ```yaml
104
+ comments:
105
+ provider : "disqus"
106
+ disqus:
107
+ shortname : "your-disqus-shortname"
108
+ ```
109
+
110
+ **Cusdis** — self-hosted or [cusdis.com](https://cusdis.com/); copy the App ID
111
+ from your dashboard:
112
+
113
+ ```yaml
114
+ comments:
115
+ provider : "cusdis"
116
+ cusdis:
117
+ appId : "your-cusdis-app-id"
118
+ ```
43
119
 
44
- Bug reports and pull requests are welcome on GitHub at https://github.com/vmsilvamolina/whiteblog-theme. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
120
+ **Giscus** enable GitHub Discussions on a public repo, install the
121
+ [giscus app](https://github.com/apps/giscus), then run the configurator at
122
+ [giscus.app](https://giscus.app/) to get the IDs:
123
+
124
+ ```yaml
125
+ comments:
126
+ provider : "giscus"
127
+ giscus:
128
+ repo : "username/repo-name"
129
+ repo_id : "..." # from giscus.app
130
+ category : "General"
131
+ category_id : "..." # from giscus.app
132
+ mapping : "pathname"
133
+ reactions_enabled : "1"
134
+ input_position : "top"
135
+ theme : "preferred_color_scheme"
136
+ lang : "en"
137
+ ```
138
+
139
+ Giscus and Cusdis follow the site's dark/light toggle without a page reload.
140
+
141
+ ### Analytics
142
+
143
+ ```yaml
144
+ analytics:
145
+ google:
146
+ tracking_id : "G-XXXXXXXXXX" # empty / false disables GA4
147
+ ```
148
+
149
+ ### Per-page frontmatter
150
+
151
+ - `head_inline` — raw HTML injected into `<head>` for a single page (extra
152
+ meta tags, a page-specific stylesheet, etc.).
153
+ - `slug` — overrides the slug used for the preview PNG path,
154
+ `assets/images/previews/<slug>.png`.
155
+
156
+ ## Post preview plugin
157
+
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:
162
+
163
+ ```bash
164
+ # macOS
165
+ brew install --cask wkhtmltopdf # provides wkhtmltoimage
166
+ brew install pngquant # optional, for compression
167
+
168
+ # Debian / Ubuntu
169
+ apt-get install wkhtmltopdf pngquant
170
+ ```
171
+
172
+ Add the gem to your site's `Gemfile`:
173
+
174
+ ```ruby
175
+ group :jekyll_plugins do
176
+ gem "imgkit"
177
+ end
178
+ ```
179
+
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.
45
182
 
46
183
  ## Development
47
184
 
48
185
  To set up your environment to develop this theme, run `bundle install`.
49
186
 
50
- Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
187
+ ```bash
188
+ bundle exec jekyll serve # local server at http://localhost:4000
189
+ bundle exec jekyll serve --drafts # include drafts
190
+ bundle exec jekyll build # production build
191
+ ```
192
+
193
+ When the theme is released, only the files in `_layouts`, `_includes`,
194
+ `_sass`, `_pages` and `assets` tracked with Git are bundled. To add a custom
195
+ directory, edit the regexp in `whiteblog-theme.gemspec`.
196
+
197
+ ## Contributing
51
198
 
52
- When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
53
- To add a custom directory to your theme-gem, please edit the regexp in `whiteblog-theme.gemspec` accordingly.
199
+ Bug reports and pull requests are welcome on GitHub at
200
+ https://github.com/vmsilvamolina/whiteblog-theme. This project is intended to
201
+ be a safe, welcoming space for collaboration, and contributors are expected to
202
+ adhere to the [Contributor Covenant](http://contributor-covenant.org) code of
203
+ conduct.
54
204
 
55
205
  ## License
56
206
 
57
- The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
207
+ The theme is available as open source under the terms of the
208
+ [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,51 @@
1
+ <script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
2
+ data-id="{{ site.addons.buymeacoffee.id }}"
3
+ data-description="{{ site.addons.buymeacoffee.description }}"
4
+ data-message="{{ site.addons.buymeacoffee.message }}"
5
+ data-color="{{ site.addons.buymeacoffee.color }}"
6
+ data-position="{{ site.addons.buymeacoffee.position }}"
7
+ data-x_margin="{{ site.addons.buymeacoffee.x_margin }}"
8
+ data-y_margin="{{ site.addons.buymeacoffee.y_margin }}"></script>
9
+ {% if site.addons.buymeacoffee.color == "" or site.addons.buymeacoffee.color == nil %}
10
+ <script>
11
+ (function() {
12
+ var s = document.querySelector('script[data-name="BMC-Widget"]');
13
+ function accent() {
14
+ return getComputedStyle(document.documentElement).getPropertyValue('--color-accent').trim();
15
+ }
16
+ s.dataset.color = accent();
17
+
18
+ // the widget only paints the button's background once at render time, so follow
19
+ // theme toggles (data-theme attribute) manually to keep it in sync
20
+ new MutationObserver(function() {
21
+ var color = accent();
22
+ s.dataset.color = color;
23
+ var btn = document.getElementById('bmc-wbtn');
24
+ if (btn) btn.style.background = color;
25
+ }).observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
26
+ })();
27
+ </script>
28
+ {% endif %}
29
+ {% if site.addons.buymeacoffee.x_margin_desktop and site.addons.buymeacoffee.x_margin_desktop != "" %}
30
+ <script>
31
+ (function() {
32
+ var side = '{{ site.addons.buymeacoffee.position }}'.toLowerCase() === 'left' ? 'left' : 'right';
33
+ var mq = window.matchMedia('(min-width: 950px)');
34
+ function position() {
35
+ var btn = document.getElementById('bmc-wbtn');
36
+ if (!btn) return;
37
+ // the widget only sets style.left/right once at render time, so this override sticks
38
+ // through its hover/click animations (which only touch style.transform)
39
+ btn.style[side] = (mq.matches ? '{{ site.addons.buymeacoffee.x_margin_desktop }}' : '{{ site.addons.buymeacoffee.x_margin }}') + 'px';
40
+ }
41
+ var observer = new MutationObserver(function() {
42
+ if (document.getElementById('bmc-wbtn')) {
43
+ position();
44
+ observer.disconnect();
45
+ }
46
+ });
47
+ observer.observe(document.body, { childList: true });
48
+ mq.addEventListener('change', position);
49
+ })();
50
+ </script>
51
+ {% endif %}
@@ -12,3 +12,7 @@
12
12
  {% if site.analytics.google.tracking_id and site.analytics.google.tracking_id != "" %}
13
13
  {% include /analytics/googleAnalytics.html %}
14
14
  {% endif %}
15
+
16
+ {% if site.addons.buymeacoffee.id and site.addons.buymeacoffee.id != "" %}
17
+ {% include buymeacoffee.html %}
18
+ {% endif %}
@@ -21,13 +21,13 @@
21
21
  }
22
22
 
23
23
  [data-theme="dark"] {
24
- --color-bg: rgb(37,36,47);
24
+ --color-bg: #1a1a2e;
25
25
  --color-accent: #44318D;
26
26
  --color-primary: #CE80EF;
27
27
  --color-text: #E8E8E8;
28
28
  --color-dark: #CCCCCC;
29
29
  --color-highlight: #D83F87;
30
- --color-code: #FF6B9D;
30
+ --color-code: #e0aaff;
31
31
  --color-code-bg: #282a36;
32
32
  --color-notice: #4A3B5C;
33
33
  --color-blockquote: #F39237;
@@ -641,6 +641,26 @@ svg {
641
641
  vertical-align: unset;
642
642
  }
643
643
 
644
+ .error-404 {
645
+ display: flex;
646
+ flex-direction: column;
647
+ align-items: center;
648
+ text-align: center;
649
+ gap: 1.5rem;
650
+ margin: 2rem 0;
651
+ }
652
+
653
+ .ascii-404 {
654
+ display: inline-block;
655
+ font-family: 'Fira Code', monospace;
656
+ color: var(--color-code);
657
+ white-space: pre;
658
+ text-align: left;
659
+ overflow-x: auto;
660
+ max-width: 100%;
661
+ line-height: 1.15;
662
+ }
663
+
644
664
  .float-abajo {
645
665
  display: flex;
646
666
  justify-content: flex-end;
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.4.2
4
+ version: 0.5.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-07-10 00:00:00.000000000 Z
11
+ date: 2026-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -83,6 +83,7 @@ files:
83
83
  - README.md
84
84
  - _includes/analytics/googleAnalytics.html
85
85
  - _includes/backtotop.html
86
+ - _includes/buymeacoffee.html
86
87
  - _includes/comments-providers/cusdis.html
87
88
  - _includes/comments-providers/disqus.html
88
89
  - _includes/comments-providers/giscus.html