abqari 1.1.1 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '035944943314205611728976da674b3459ebe5b38cc7bcf7ac037dac5726dc39'
4
- data.tar.gz: ca10d8e3ba566d54f81b6d6ad20779a8252e9eb768e508d5d911a75807e5f2a2
3
+ metadata.gz: fd411b1e1b18a824d5cee74ee6e557c7135fc973f6fc9edb4f4c806edff7cadf
4
+ data.tar.gz: bb34137c4de0ffb733d1b911f6e523df2cde7b933d196e07d0e4ca4a4fb91460
5
5
  SHA512:
6
- metadata.gz: 987bc6ee6e1e9186193f6a35745559a3e5b1c383b634e681df38c94016b45ab766b2d8d0d6215e6bca88c741d95f4ffff70c2e9be904ea1e93b32ee0c9280397
7
- data.tar.gz: 94f4ec0a8576c75d6b30b5f7a306dc44bb0cad5fe2312ab075b419efe3b9227f9a02a7676b289fa062ad4d46e7bf470a288f45ad0503d937fd009281de20e5d8
6
+ metadata.gz: b1c8ea8aa8cad1f13f9dc3eddd81fbbedf891d024b6998f8a1f7aacf7c45c66ce783bea05174d983973c46eac5318372addd0d8b590e29871723f29f1d71a40c
7
+ data.tar.gz: 2820827176cec3ecaaf08ad2ceb70c15b506435368154e24d2afc7ea544f2fe959613da696e2bb05eb81eff3011d4c37e07081565e1c4fa2ae2e901073b4e5c8
data/CHANGELOG.md CHANGED
@@ -9,6 +9,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  _Nothing yet._
11
11
 
12
+ ## [1.1.2] — 2026-10-09
13
+
14
+ ### Fixed
15
+
16
+ - **Changing `fonts:` and re-running `bin/fetch-fonts` didn't reach
17
+ returning visitors; they kept the old fonts for up to a year.** The
18
+ head linked the font stylesheet at a fixed `/assets/fonts/fonts.css`,
19
+ and the generated `_headers` serves all of `/assets/*` with
20
+ `Cache-Control: public, max-age=31536000, immutable`, so a browser
21
+ that had cached the old file never asked for it again. The new
22
+ families fell back to system fonts. It hid because a first visit, a
23
+ hard reload, and the dev server (which doesn't apply `_headers`) all
24
+ show the new fonts; only returning visitors on a host that honours
25
+ `_headers` were stuck. `syntax.css` had the same bug before the CSS
26
+ bundle.
27
+
28
+ `vendor/fonts/fonts.css` now goes through the asset pipeline and is
29
+ linked as `/assets/fonts/fonts.<hash>.css`, minified in production,
30
+ so a re-fetch changes the URL. Dev-server rebuilds now re-render
31
+ every page after a re-fetch, because every head carries the hash.
32
+ The head no longer emits the link when `fonts:` is set but
33
+ `bin/fetch-fonts` hasn't run; it used to link a stylesheet that
34
+ 404'd.
35
+
36
+ If your site overrides `_head.html.erb`, change its font link to
37
+ `<%= asset_path('fonts/fonts.css') %>`. The unhashed copy still ships
38
+ at `/assets/fonts/fonts.css`, so an overridden head keeps working,
39
+ but it keeps the stale-cache problem.
40
+
12
41
  ## [1.1.1] — 2026-08-11
13
42
 
14
43
  Bug-fix release, all of it found while building a site against the
@@ -958,7 +987,8 @@ run a real working author / publisher site.
958
987
  commonmarker ≥ 2.4 ships precompiled 4.0 binaries, which is what
959
988
  the `~> 2.4` floor bought.
960
989
 
961
- [Unreleased]: https://github.com/grantrayner/abqari/compare/v1.1.1...HEAD
990
+ [Unreleased]: https://github.com/grantrayner/abqari/compare/v1.1.2...HEAD
991
+ [1.1.2]: https://github.com/grantrayner/abqari/compare/v1.1.1...v1.1.2
962
992
  [1.1.1]: https://github.com/grantrayner/abqari/compare/v1.1.0...v1.1.1
963
993
  [1.1.0]: https://github.com/grantrayner/abqari/compare/v1.0.0...v1.1.0
964
994
  [1.0.0]: https://github.com/grantrayner/abqari/releases/tag/v1.0.0
data/README.md CHANGED
@@ -11,7 +11,7 @@ optional overrides), while the engine — layouts, themes, helpers, asset
11
11
  pipeline — lives in the dependency. Forking the engine is also
12
12
  supported for users who want to own all the code.
13
13
 
14
- > **Status:** v1.1.1 — see
14
+ > **Status:** v1.1.2 — see
15
15
  > [CHANGELOG.md](https://github.com/grantrayner/abqari/blob/main/CHANGELOG.md).
16
16
  > Distributed via RubyGems (`gem install abqari`) and as a Bundler
17
17
  > path/git source. The API follows [semver](https://semver.org/) from
@@ -174,7 +174,7 @@ Test that it worked:
174
174
  abqari version
175
175
  ```
176
176
 
177
- You should see a version number, e.g. `abqari 1.1.1`. If you get
177
+ You should see a version number, e.g. `abqari 1.1.2`. If you get
178
178
  `command not found`, see [Troubleshooting](#troubleshooting) below.
179
179
 
180
180
  ### Step 3 — Create your first site
@@ -470,7 +470,7 @@ end
470
470
  Or — pin to a git ref while tracking pre-release work:
471
471
 
472
472
  ```ruby
473
- gem 'abqari', git: 'https://github.com/grantrayner/abqari.git', tag: 'v1.1.1'
473
+ gem 'abqari', git: 'https://github.com/grantrayner/abqari.git', tag: 'v1.1.2'
474
474
  ```
475
475
 
476
476
  Install the libvips C library once (hard dep for the image pipeline):
@@ -1629,7 +1629,9 @@ Then run once:
1629
1629
  bin/fetch-fonts
1630
1630
  ```
1631
1631
 
1632
- Abqari downloads the woff2 files to `vendor/fonts/`, generates a `fonts.css` with rewritten URLs, and serves everything from `/assets/fonts/` at build time. The head partial conditionally includes the link tag whenever `fonts:` is configured.
1632
+ Abqari downloads the woff2 files to `vendor/fonts/`, generates a `fonts.css` with rewritten URLs, and serves everything from `/assets/fonts/` at build time. The stylesheet is fingerprinted like any other asset (`/assets/fonts/fonts.<hash>.css`), so changing `fonts:` and re-running `bin/fetch-fonts` busts the immutable cache. The head partial links it whenever `fonts:` is configured and the fetch has run.
1633
+
1634
+ If you override the head partial, link the stylesheet with `<%= asset_path('fonts/fonts.css') %>`. An unhashed copy still ships at `/assets/fonts/fonts.css`, but `_headers` caches it for a year, so returning visitors won't see font changes.
1633
1635
 
1634
1636
  ## Icons
1635
1637
 
@@ -2550,7 +2552,7 @@ taking a feature release. To track a fork or an unreleased branch
2550
2552
  instead, swap the line for a git source:
2551
2553
 
2552
2554
  ```ruby
2553
- gem 'abqari', git: 'https://github.com/grantrayner/abqari.git', tag: 'v1.1.1'
2555
+ gem 'abqari', git: 'https://github.com/grantrayner/abqari.git', tag: 'v1.1.2'
2554
2556
  ```
2555
2557
 
2556
2558
  The cadence: read [CHANGELOG.md](https://github.com/grantrayner/abqari/blob/main/CHANGELOG.md) before each upgrade,
@@ -367,8 +367,12 @@
367
367
  <% Array(site.config['fonts_preload']).each do |path| %>
368
368
  <link rel="preload" href="<%= sanitized_url(path) %>" as="font" type="font/woff2" crossorigin>
369
369
  <% end %>
370
- <% if Array(site.config['fonts']).any? %>
371
- <link rel="stylesheet" href="/assets/fonts/fonts.css">
370
+ <%# Fingerprinted, never the fixed `/assets/fonts/fonts.css` — that
371
+ URL is cached `immutable`, so a re-fetch never reached returning
372
+ visitors. No link until `bin/fetch-fonts` has run. %>
373
+ <% fonts_css = Array(site.config['fonts']).any? && optional_asset_path('fonts/fonts.css') %>
374
+ <% if fonts_css %>
375
+ <link rel="stylesheet" href="<%= fonts_css %>">
372
376
  <% end %>
373
377
  <%# Render-blocking CSS ships as ONE fingerprinted bundle (syntax +
374
378
  _common + theme app.css + site.css, same cascade order as the
@@ -8,6 +8,7 @@ module Abqari
8
8
  OUTPUT_SUBDIR = 'assets'
9
9
  HASH_LENGTH = 10
10
10
  BUNDLE_LOGICAL = 'css/bundle.css'
11
+ FONTS_LOGICAL = 'fonts/fonts.css'
11
12
  # A theme name is a directory name under themes/ and nothing more.
12
13
  # The strict pattern is load-bearing: the name is joined into
13
14
  # filesystem paths in several places (here, ArtifactWriter,
@@ -55,6 +56,7 @@ module Abqari
55
56
  [engine_app_assets, site_app_assets].uniq.each do |dir|
56
57
  process_dir(dir) if dir && Dir.exist?(dir)
57
58
  end
59
+ process_font_stylesheet
58
60
  build_css_bundle
59
61
  end
60
62
 
@@ -172,6 +174,22 @@ module Abqari
172
174
  @paths[logical] = "/#{OUTPUT_SUBDIR}/#{fingerprinted}"
173
175
  end
174
176
 
177
+ # The `bin/fetch-fonts` stylesheet gets a content hash like any
178
+ # other asset. At its old fixed URL it sat under the `/assets/*
179
+ # immutable` cache rule, so a site that changed `fonts:` and
180
+ # re-fetched kept serving returning visitors the old `@font-face`
181
+ # rules for a year. Its woff2 `url()`s are root-absolute, so the
182
+ # renamed file still resolves them. ArtifactWriter#copy_fonts keeps
183
+ # shipping the unhashed copy for sites that override the head.
184
+ def process_font_stylesheet
185
+ source = File.join(@site.site_root, 'vendor', 'fonts', 'fonts.css')
186
+ return unless File.file?(source)
187
+ return if @site.external_symlink?(source)
188
+
189
+ write_asset(FONTS_LOGICAL, processed_content(source, FONTS_LOGICAL))
190
+ @sources[FONTS_LOGICAL] = source
191
+ end
192
+
175
193
  def processed_content(entry, logical)
176
194
  raw = File.binread(entry)
177
195
  kind = MINIFY_KINDS[File.extname(logical)]
@@ -48,13 +48,17 @@ module Abqari
48
48
  # `compute_shared_deps_mtime` time so we only walk the active
49
49
  # theme's directory, not every theme that happens to ship with
50
50
  # the gem.
51
+ #
52
+ # `vendor/fonts/fonts.css` is here because every page's head links
53
+ # it by content hash; a re-fetch must re-render them all.
51
54
  GLOBAL_DEP_GLOBS = [
52
55
  'app/views/partials/**/*',
53
56
  'app/icons/**/*',
54
57
  'app/assets/**/*',
55
58
  'lib/**/*',
56
59
  'config/**/*',
57
- 'data/**/*'
60
+ 'data/**/*',
61
+ 'vendor/fonts/fonts.css'
58
62
  ].freeze
59
63
 
60
64
  # The renderer only needs the frontmatter block (no body), but
@@ -14,5 +14,5 @@
14
14
  #
15
15
  # Keep this file dependency-free.
16
16
  module Abqari
17
- VERSION = '1.1.1'
17
+ VERSION = '1.1.2'
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abqari
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Rayner