pandorga 1.7.0 → 1.7.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/DESIGN.md +9 -9
  4. data/_data/themes/dark.yml +2 -1
  5. data/_includes/content-runtime/30-includes.html +1 -1
  6. data/_includes/content-runtime/43-blocks.html +1 -1
  7. data/_includes/content-runtime/50-detail.html +5 -5
  8. data/_includes/content-runtime/60-fragments.html +3 -3
  9. data/_includes/page/network-graph.html +2 -2
  10. data/_includes/page/page-header.html +3 -1
  11. data/_includes/page/site-footer.html +2 -2
  12. data/_includes/theme/json-ld.html +35 -2
  13. data/_layouts/articles.html +1 -1
  14. data/_layouts/projects.html +2 -2
  15. data/_layouts/resources.html +1 -1
  16. data/_layouts/shell.html +4 -4
  17. data/_layouts/text.html +4 -4
  18. data/_plugins/lib/writing_entry.rb +1 -1
  19. data/_plugins/local_detail_rewrites.rb +10 -1
  20. data/assets/css/article.css +3 -3
  21. data/assets/css/base.css +0 -79
  22. data/assets/css/global-link.css +0 -1
  23. data/assets/css/ledger/chrome.css +1 -1
  24. data/assets/css/ledger/cv.css +1 -1
  25. data/assets/css/ledger/detail.css +1 -1
  26. data/assets/css/ledger/footer.css +1 -1
  27. data/assets/css/ledger/home.css +13 -42
  28. data/assets/css/ledger/projects.css +2 -2
  29. data/assets/css/ledger/sources.css +3 -3
  30. data/assets/css/ledger/writing.css +1 -1
  31. data/lib/pandorga/detail_routes.rb +29 -0
  32. data/lib/pandorga/jekyll/plugins/detail_documents.rb +154 -0
  33. data/lib/pandorga/jekyll/plugins/lib/writing_entry.rb +1 -1
  34. data/lib/pandorga/jekyll/plugins/local_detail_rewrites.rb +10 -1
  35. data/lib/pandorga/version.rb +1 -1
  36. data/scripts/content/export-content-json.rb +1 -1
  37. data/scripts/test/render-parity/load-runtime.mjs +1 -1
  38. data/scripts/test/test-css-structure.rb +20 -0
  39. data/scripts/test/test-discovery.rb +36 -0
  40. data/scripts/test/test-examples-build.rb +90 -0
  41. data/scripts/test/test-fonts.rb +14 -0
  42. data/scripts/test/test-hero-portraits.mjs +12 -2
  43. data/scripts/test/test-hero-portraits.rb +12 -4
  44. data/scripts/test/test-lighthouse-policy.rb +4 -0
  45. data/scripts/test/test-listing-filter-contract.rb +1 -1
  46. data/scripts/test/test-shell-a11y.rb +27 -0
  47. data/scripts/test/test-theme-contrast.rb +43 -0
  48. data/scripts/validate.sh +6 -0
  49. metadata +4 -1
@@ -347,7 +347,7 @@ html[data-theme="light"] .cv-product {
347
347
 
348
348
  /* A place is prose, not notation, so it reads in the body face rather than
349
349
  mono — and on the same left edge as every other line of the card. The pin
350
- icon and the indent it sat beNewsreader said nothing the word "France" does not
350
+ icon and the indent it sat behind said nothing the word "France" does not
351
351
  already say, and cost the entry its one straight margin. */
352
352
  .cv-entry-place {
353
353
  color: var(--color-on-surface-variant);
@@ -14,7 +14,7 @@
14
14
  to beat one are written with two compound parts on purpose. */
15
15
 
16
16
  /* ══ Reading progress ══
17
- Pure UI state, no field beNewsreader it, and no DOM hook to hang it on — the
17
+ Pure UI state, no field behind it, and no DOM hook to hang it on — the
18
18
  runtime owns the detail markup. A scroll-driven animation on a pseudo of
19
19
  the detail section gives the mockup's indicator with zero markup, and the
20
20
  @supports guard means older engines simply get no bar.
@@ -230,7 +230,7 @@
230
230
  }
231
231
 
232
232
  /* A middot between items rather than a separator element, so an absent
233
- license leaves no orphaned punctuation beNewsreader. */
233
+ license leaves no orphaned punctuation behind. */
234
234
  .site-footer-imprint-item+.site-footer-imprint-item::before {
235
235
  content: "·";
236
236
  margin-right: var(--space-md);
@@ -49,18 +49,6 @@
49
49
  }
50
50
  }
51
51
 
52
- /* Structural edge: the short rule the mockup runs along the top-left of the
53
- featured band, marking it as the page's first statement after the hero. */
54
- .home-band--ruled::before {
55
- content: "";
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- width: 6rem;
60
- height: 3px;
61
- background: var(--color-primary);
62
- }
63
-
64
52
  /* ── Hero ── */
65
53
  /* The band was 3rem above the name and 4.5rem below, which read as the block
66
54
  sitting low in its own space. Equal above and below, at 60% of the larger
@@ -117,7 +105,7 @@
117
105
  }
118
106
  }
119
107
 
120
- /* Ambient pool beNewsreader the hero.
108
+ /* Ambient pool behind the hero.
121
109
  *
122
110
  * Same weight as the earlier primary-container bloom, but keyed to neutral
123
111
  * ink/outline so it stays grey paper depth instead of a blue spotlight. */
@@ -418,7 +406,7 @@ html[data-theme="light"] .home-hero-plate {
418
406
  box-shadow: none;
419
407
  }
420
408
 
421
- /* Silk facet beNewsreader the portrait — restored; the Borders pass had hidden it. */
409
+ /* Silk facet behind the portrait — restored; the Borders pass had hidden it. */
422
410
  .home-hero-shard {
423
411
  top: -2.25rem;
424
412
  right: -2rem;
@@ -576,8 +564,7 @@ html[data-theme="light"] .home-hero-plate {
576
564
  was the piece the band leads with, and a reader scanning down met four
577
565
  equal entries. It now takes the card rung of the surface ladder, is fenced
578
566
  by the same hairline every other panel on the site carries, and opens on a
579
- rule in the primary — the structural edge this page already uses on
580
- `.home-band--ruled` — so the eye stops at the top of it. The image inside is
567
+ rule in the primary, so the eye stops at the top of it. The image inside is
581
568
  inset by the panel's own padding rather than running to the band edge, which
582
569
  is the other half of the promotion: the lead contains its picture, the cards
583
570
  below are contained by theirs.
@@ -646,7 +633,7 @@ html[data-theme="light"] .home-hero-plate {
646
633
  cubist half of the identity.
647
634
 
648
635
  The pair is placed around the poster rather than across the card, because
649
- the poster is opaque and a shard beNewsreader it is a shard nobody sees. The
636
+ the poster is opaque and a shard behind it is a shard nobody sees. The
650
637
  alpha takes the top-left, over the index column, where there is nothing but
651
638
  chrome and air. The beta takes the bottom-right and comes out from *under*
652
639
  the poster into the strip below it, which is the same move the index band
@@ -1050,8 +1037,8 @@ html[data-theme="light"] .home-hero-plate {
1050
1037
  box-sizing: border-box;
1051
1038
  }
1052
1039
 
1053
- /* The triad top rule (`.ledger-card--edge-primary`), restated at a weight
1054
- that beats the light-paper hairline reset on `.ledger-system-card`. */
1040
+ /* A primary top rule, at a weight that beats the light-paper hairline
1041
+ reset on `.ledger-system-card`. */
1055
1042
  :root .home-projects-bench .home-project-specimen,
1056
1043
  :root .home-projects-bench .home-project-specimen:hover {
1057
1044
  border-top: 2px solid var(--color-primary);
@@ -1568,11 +1555,11 @@ button.home-project-inventory-row {
1568
1555
  The figure is hidden until the markup lands, so a plate that never arrives
1569
1556
  leaves the panel with its title and its link rather than an empty frame. */
1570
1557
 
1571
- /* Ambient pool beNewsreader the pair. Dark palette only, for the reason set out
1558
+ /* Ambient pool behind the pair. Dark palette only, for the reason set out
1572
1559
  above the hero's.
1573
1560
  *
1574
- * The two panels sat side by side with a visible seam and nothing beNewsreader
1575
- * them. One pool centred on that seam, beNewsreader both, lights the pair as a
1561
+ * The two panels sat side by side with a visible seam and nothing behind
1562
+ * them. One pool centred on that seam, behind both, lights the pair as a
1576
1563
  * single object rather than giving each panel an opening of its own. Held at
1577
1564
  * 5% against the hero's 7%: at equal strength the page reads as having two
1578
1565
  * openings, and only one of them is where it starts.
@@ -1580,7 +1567,7 @@ button.home-project-inventory-row {
1580
1567
  * Centred is right here and nowhere else — the seam is the thing being lit,
1581
1568
  * so the offset is vertical instead, which is what keeps the pool partly
1582
1569
  * outside the band it backs. `.home-band` already carries `position:
1583
- * relative`; `isolation: isolate` is what stops `z-index: -1` escaping beNewsreader
1570
+ * relative`; `isolation: isolate` is what stops `z-index: -1` escaping behind
1584
1571
  * the page background. */
1585
1572
  .home-band--index {
1586
1573
  isolation: isolate;
@@ -1642,7 +1629,7 @@ button.home-project-inventory-row {
1642
1629
  the set, rotating hue the way every other shard on the site does.
1643
1630
  *
1644
1631
  * They sit in the foot of the panel, under the title and the link: the plate
1645
- * above carries an opaque background, so a shard beNewsreader it would be a shard
1632
+ * above carries an opaque background, so a shard behind it would be a shard
1646
1633
  * nobody sees. `overflow: hidden` on the panel above keeps the negative
1647
1634
  * offsets out of the document scroll width, and the shared utility already
1648
1635
  * unmounts both below 640px. */
@@ -1663,21 +1650,12 @@ button.home-project-inventory-row {
1663
1650
  background: var(--color-primary);
1664
1651
  }
1665
1652
 
1666
- .home-index-shard--gamma {
1667
- right: -3rem;
1668
- bottom: -3.5rem;
1669
- width: 11rem;
1670
- height: 11rem;
1671
- background: var(--color-tertiary);
1672
- }
1673
-
1674
1653
  /* Between the shard cut-off and the layout each panel is the full
1675
1654
  band wide on small screens, so a shard sized for half of it stops being a corner accent. */
1676
1655
  @media (max-width: 899px) {
1677
1656
 
1678
1657
  .home-index-shard,
1679
- .home-index-shard--beta,
1680
- .home-index-shard--gamma {
1658
+ .home-index-shard--beta {
1681
1659
  width: 8rem;
1682
1660
  height: 8rem;
1683
1661
  bottom: -2.5rem;
@@ -1688,7 +1666,7 @@ button.home-project-inventory-row {
1688
1666
  padding-top: var(--space-xl);
1689
1667
  }
1690
1668
 
1691
- /* The title and the link have to sit clear of the shard beNewsreader them. The
1669
+ /* The title and the link have to sit clear of the shard behind them. The
1692
1670
  plate is excluded because it is the one child that must stay full-bleed,
1693
1671
  and the shard because it is the thing being sat clear of. */
1694
1672
  .home-index-panel> :not(.home-index-plate):not(.shard-accent) {
@@ -1697,13 +1675,6 @@ button.home-project-inventory-row {
1697
1675
  margin-inline: var(--space-lg);
1698
1676
  }
1699
1677
 
1700
- .home-index-note {
1701
- margin: 0;
1702
- font-size: var(--type-body);
1703
- line-height: 1.5;
1704
- flex: 1 1 auto;
1705
- }
1706
-
1707
1678
  .home-index-title {
1708
1679
  margin: 0;
1709
1680
  font-size: var(--type-card);
@@ -183,7 +183,7 @@
183
183
  position: relative;
184
184
  display: block;
185
185
  text-decoration: none;
186
- /* Empty blueprint as texture beNewsreader the plate — not a second view mode. */
186
+ /* Empty blueprint as texture behind the plate — not a second view mode. */
187
187
  background-color: var(--color-panel-contrast);
188
188
  background-image:
189
189
  linear-gradient(color-mix(in srgb, var(--color-outline) 10%, transparent) 1px, transparent 1px),
@@ -350,7 +350,7 @@
350
350
 
351
351
  /* ══ Repositories ══
352
352
  The mockup closed on a source-code ledger. Its licence stamp, spec
353
- download and commit hashes have nothing beNewsreader them; the repository rows
353
+ download and commit hashes have nothing behind them; the repository rows
354
354
  do — `github` is set on five of the seven projects. */
355
355
  .projects-page .projects-repos {
356
356
  margin-top: var(--space-3xl);
@@ -9,7 +9,7 @@
9
9
 
10
10
  /* ── Shards ──
11
11
  The page had no depth treatment of any kind, and it is the wrong shape for
12
- the ambient pool the home bands carry: a pool beNewsreader a grid of many small
12
+ the ambient pool the home bands carry: a pool behind a grid of many small
13
13
  cards only darkens one corner of it. Shards instead, the two canonical
14
14
  polygons from base.css, one at each end of the run — top right above the
15
15
  grid, bottom left below it, the diagonal pair the CV dossier uses inside
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  /* A card is not positioned, so without this the shard — which is — would be
59
- painted over the bottom row rather than beNewsreader it. The rule the whole
59
+ painted over the bottom row rather than behind it. The rule the whole
60
60
  family answers to is that a backdrop never touches the object in front of
61
61
  it. */
62
62
  .sources-body>.listing-card-grid,
@@ -65,7 +65,7 @@
65
65
  z-index: 1;
66
66
  }
67
67
 
68
- /* The foot of the page, beside the pagination. It reaches up beNewsreader the last
68
+ /* The foot of the page, beside the pagination. It reaches up behind the last
69
69
  row of cards. In dark those cards are opaque again, so what shows is the
70
70
  wedge in the gutter and the band across the pagination strip. */
71
71
  .sources-foot-shard {
@@ -70,7 +70,7 @@
70
70
  The alpha sits bottom left, under the foot of the copy, the one corner the
71
71
  plate never reaches at any width. The beta is a true corner accent at the
72
72
  top right: it is offset far enough up that its visible part is the triangle
73
- above the plate's top edge, and it tucks beNewsreader the plate as it descends
73
+ above the plate's top edge, and it tucks behind the plate as it descends
74
74
  rather than fighting it. Neither corner repeats the home panel's pair, and
75
75
  the hues are the only two this page has — `.page-accent--green` rebinds
76
76
  primary onto secondary, so green and ochre is the whole palette here. */
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pandorga
4
+ # Detail URLs that used to be 200-rewritten onto a listing shell.
5
+ # Cloudflare follows `_redirects` even when a static file exists, so the
6
+ # built file must drop those splat lines or the generated page is never
7
+ # served. The source file is left alone.
8
+ module DetailRoutes
9
+ SPLAT_LINE = %r{\A/(?:articles|posts|blog|projects|products)/(?::slug|\*)/?\s+\S+\s+200\s*\z}
10
+
11
+ module_function
12
+
13
+ def strip_splat_rewrites(text)
14
+ text.to_s.lines.reject { |line| SPLAT_LINE.match?(line.strip) }.join
15
+ end
16
+
17
+ def static_index?(root, path)
18
+ root = root.to_s
19
+ return false if root.empty?
20
+
21
+ clean = path.to_s.split("?").first.to_s
22
+ relative = clean.sub(%r{\A/}, "").sub(%r{/\z}, "")
23
+ return false if relative.empty? || relative.include?("..")
24
+
25
+ File.file?(File.join(root, relative, "index.html")) ||
26
+ File.file?(File.join(root, "#{relative}.html"))
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,154 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "jekyll"
4
+ require "pathname"
5
+
6
+ require_relative "../../detail_routes"
7
+ require_relative "lib/writing_entry"
8
+
9
+ module Pandorga
10
+ module Jekyll
11
+ # One static page per published article, post, project, and product.
12
+ # The listing layout stays, so the client still opens the entry from
13
+ # the URL. `listing_path` stays the listing URL. The permalink is the
14
+ # detail URL, which is what the sitemap and the static canonical use.
15
+ class DetailDocumentsGenerator < ::Jekyll::Generator
16
+ safe true
17
+ priority :low
18
+
19
+ COLLECTION_FOR_TYPE = {
20
+ "article" => "articles",
21
+ "post" => "posts",
22
+ "project" => "projects",
23
+ "product" => "products"
24
+ }.freeze
25
+
26
+ DETAIL_PATTERN = {
27
+ "article" => "/articles/:slug/",
28
+ "post" => "/posts/:slug/",
29
+ "project" => "/projects/:slug/",
30
+ "product" => "/products/:slug/"
31
+ }.freeze
32
+
33
+ SCHEMA = {
34
+ "article" => "Article",
35
+ "post" => "BlogPosting"
36
+ }.freeze
37
+
38
+ def generate(site)
39
+ return if site.config["shell_content_agnostic"]
40
+
41
+ root = Pathname.new(site.source)
42
+ COLLECTION_FOR_TYPE.each do |type, collection|
43
+ listing = listing_page(site, type)
44
+ next unless listing
45
+ next if listing.data["listing_path"].to_s.empty?
46
+
47
+ directory = root.join(ContentKeys::CONTENT_PATHS.fetch(type))
48
+ next unless directory.directory?
49
+
50
+ Dir.glob(directory.join("*.{md,markdown}")).sort.each do |absolute|
51
+ emit(site, listing, type, collection, absolute, root)
52
+ end
53
+ end
54
+ end
55
+
56
+ private
57
+
58
+ def emit(site, listing, type, collection, absolute, root)
59
+ relative = Pathname.new(absolute).relative_path_from(root.join("content"))
60
+ repo_relative = Pathname.new("content").join(relative).to_s
61
+ record = WritingEntry.build(absolute, collection, repo_relative)
62
+ return if record.nil?
63
+
64
+ detail_path = record["url"].to_s
65
+ return if detail_path.empty?
66
+ return if taken?(site, detail_path)
67
+
68
+ front_matter, = ContentKeys.split_front_matter(File.read(absolute))
69
+ dir = detail_path.sub(%r{\A/}, "").sub(%r{/\z}, "")
70
+ page = ::Jekyll::PageWithoutAFile.new(site, site.source, dir, "index.html")
71
+ page.data["layout"] = listing.data["layout"]
72
+ page.data["permalink"] = detail_path
73
+ page.data["canonical_url"] = detail_path
74
+ page.data["listing_path"] = listing.data["listing_path"]
75
+ page.data["collection"] = collection
76
+ page.data["detail"] = listing.data["detail"].to_s
77
+ page.data["detail"] = DETAIL_PATTERN.fetch(type) if page.data["detail"].empty?
78
+ page.data["detail_document"] = true
79
+ page.data["accent"] = listing.data["accent"] if listing.data["accent"]
80
+ title = record["title"].to_s.strip
81
+ title = record["key"].to_s if title.empty?
82
+ page.data["title"] = title unless title.empty?
83
+ description = record["description"].to_s.strip
84
+ description = record["excerpt"].to_s.strip if description.empty?
85
+ page.data["description"] = description unless description.empty?
86
+ page.data["date"] = record["date"] unless record["date"].to_s.empty?
87
+ page.data["last_updated"] = record["last_updated"] unless record["last_updated"].to_s.empty?
88
+ thumbnail = record["thumbnail"].to_s.strip
89
+ page.data["thumbnail"] = thumbnail unless thumbnail.empty?
90
+ lang = front_matter["language"] || front_matter["lang"] || listing.data["lang"]
91
+ page.data["lang"] = lang if lang
92
+ if SCHEMA.key?(type)
93
+ page.data["og_type"] = "article"
94
+ page.data["schema_type"] = SCHEMA.fetch(type)
95
+ end
96
+ page.content = ""
97
+ site.pages << page
98
+ end
99
+
100
+ def taken?(site, detail_path)
101
+ site.pages.any? do |page|
102
+ page.data["permalink"].to_s == detail_path || page.url.to_s == detail_path
103
+ end
104
+ end
105
+
106
+ def listing_page(site, type)
107
+ entry = registry_entry(site, type)
108
+ return nil unless entry
109
+
110
+ site.pages.find do |page|
111
+ page.data["detail_document"] != true && page.data["key"].to_s == entry["key"].to_s
112
+ end
113
+ end
114
+
115
+ def registry_entry(site, type)
116
+ pages = site.data["pandorga_pages"]
117
+ return nil unless pages.is_a?(Array)
118
+
119
+ pages.find { |entry| entry.is_a?(Hash) && registry_match?(entry, type) }
120
+ end
121
+
122
+ def registry_match?(entry, type)
123
+ case type
124
+ when "article"
125
+ entry["template"].to_s == "articles" || entry["collection"].to_s == "articles"
126
+ when "post"
127
+ entry["template"].to_s == "blog" || entry["collection"].to_s == "posts"
128
+ when "project"
129
+ entry["template"].to_s == "portfolio" || entry["collection"].to_s == "projects"
130
+ when "product"
131
+ cols = entry["collections"]
132
+ entry["template"].to_s == "cv" ||
133
+ (cols.is_a?(Hash) && !cols["products"].to_s.empty?)
134
+ else
135
+ false
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+
142
+ Jekyll::Hooks.register :site, :post_write do |site|
143
+ # Jekyll skips underscore files, so a source `_redirects` never reaches
144
+ # the output unless the site lists it under `include`. The published
145
+ # file has to be the one Cloudflare reads.
146
+ dest = File.join(site.dest, "_redirects")
147
+ source = File.join(site.source, "_redirects")
148
+ File.write(dest, File.read(source)) if !File.file?(dest) && File.file?(source)
149
+ next unless File.file?(dest)
150
+
151
+ original = File.read(dest)
152
+ stripped = Pandorga::DetailRoutes.strip_splat_rewrites(original)
153
+ File.write(dest, stripped) if stripped != original
154
+ end
@@ -15,7 +15,7 @@ require_relative "text_excerpt"
15
15
  # (standalone, for scripts/content/export-content-json.rb). They differ only in how
16
16
  # they derive the repo-relative path used for Git chronology, so each passes
17
17
  # its own. Everything downstream lives here, because a field added or a bug
18
- # fixed in one copy used to leave the other silently beNewsreader.
18
+ # fixed in one copy used to leave the other silently behind.
19
19
  module WritingEntry
20
20
  XCITE_RE = /\{%-?\s*include\s+xcite\.html\s+key=["']([^"']+)["'][^%]*-?%\}/
21
21
 
@@ -6,6 +6,14 @@ require "net/http"
6
6
  require "uri"
7
7
  require_relative "content_detail_paths"
8
8
 
9
+ # The gem copy and the _plugins copy stay the same file. Either path can
10
+ # resolve the shared helper.
11
+ detail_routes = [
12
+ File.expand_path("../../../detail_routes", __dir__),
13
+ File.expand_path("../lib/pandorga/detail_routes", __dir__)
14
+ ].find { |path| File.file?("#{path}.rb") }
15
+ require detail_routes if detail_routes
16
+
9
17
  # Mirrors Cloudflare _redirects detail rewrites during `jekyll serve` so
10
18
  # /posts/:slug/ and /articles/:slug/ work locally without per-slug HTML files.
11
19
  # Also handles the local dev re-export endpoint and proxies /api/studio/* to
@@ -115,7 +123,8 @@ module Jekyll
115
123
  end
116
124
 
117
125
  target = ContentDetailPaths.rewrite_path(req.path)
118
- if target
126
+ root = instance_variable_get(:@root)
127
+ if target && !Pandorga::DetailRoutes.static_index?(root, req.path)
119
128
  req.instance_variable_set(:@path, target)
120
129
  req.instance_variable_set(:@path_info, target)
121
130
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pandorga
4
- VERSION = "1.7.0"
4
+ VERSION = "1.7.2"
5
5
  end
@@ -269,7 +269,7 @@ def prune_stale_output_files!
269
269
  end
270
270
 
271
271
  stale.each(&:delete)
272
- # Remove empty directories left beNewsreader by unpublish/rename.
272
+ # Remove empty directories left behind by unpublish/rename.
273
273
  OUTPUT_ROOT.find.sort.reverse_each do |path|
274
274
  next unless path.directory?
275
275
  next if path == OUTPUT_ROOT
@@ -5,7 +5,7 @@
5
5
  // and a Jekyll build never executes them, which is how a block that renders
6
6
  // an element with no backing field ships green. This loader concatenates the
7
7
  // partials in the exact order _includes/page/content-runtime.html includes
8
- // them, evaluates the result beNewsreader a deliberately thin DOM shim, and hands
8
+ // them, evaluates the result behind a deliberately thin DOM shim, and hands
9
9
  // back the same object 90-bootstrap.html returns to the browser.
10
10
  //
11
11
  // The shim is small on purpose: createElement, className, setAttribute,
@@ -72,6 +72,26 @@ sheets.each do |path|
72
72
  if source.include?("home-profile-summary")
73
73
  errors << "#{relative}: .home-profile-summary is unused"
74
74
  end
75
+
76
+ # Selectors that matched no template, runtime string, or current content.
77
+ # A comment may still name one; a ruleset may not.
78
+ retired = %w[
79
+ page-title
80
+ ledger-marker--primary
81
+ ledger-card--edge-primary
82
+ ledger-card--edge-secondary
83
+ ledger-card--edge-tertiary
84
+ ledger-section-rule
85
+ home-band--ruled
86
+ home-index-shard--gamma
87
+ home-index-note
88
+ post-content
89
+ ]
90
+ retired.each do |name|
91
+ next unless cleaned.match?(/[.#]#{Regexp.escape(name)}\b/)
92
+
93
+ errors << "#{relative}: .#{name} is unused"
94
+ end
75
95
  end
76
96
 
77
97
  fail!("CSS structure problems:\n - #{errors.join("\n - ")}") unless errors.empty?
@@ -3,9 +3,13 @@
3
3
 
4
4
  # Portrait sources and discovery documents (PLT-AC-20, PLT-AC-21).
5
5
 
6
+ require "fileutils"
6
7
  require "pathname"
7
8
 
9
+ require "tmpdir"
10
+
8
11
  require_relative "../../lib/pandorga/discovery"
12
+ require_relative "../../lib/pandorga/detail_routes"
9
13
 
10
14
  ROOT = Pathname.new(__dir__).join("..", "..").expand_path
11
15
 
@@ -41,6 +45,38 @@ fail!("portrait srcset is not read") unless runtime.include?("record.srcset = sr
41
45
  fail!("portrait sources are not applied") unless runtime.include?("applyHeroPortraitSources")
42
46
  shell = ROOT.join("_layouts/shell.html").read
43
47
  fail!("shell missing JSON-LD") unless shell.include?("theme/json-ld.html")
48
+ og_images = shell.scan(/property="og:image"/)
49
+ fail!("shell emits #{og_images.size} og:image properties; one page, one image") unless og_images.size == 1
50
+ image_meta = shell[/<meta name="image"[^>]*>/]
51
+ fail!("shell missing name=image") unless image_meta
52
+ fail!("name=image also sets property=og:image") if image_meta.include?("property=")
44
53
  fail!("discovery generator is not loaded from the plugin dir") unless ROOT.join("lib/pandorga/jekyll/plugins/discovery.rb").file?
54
+ fail!("detail pages are not generated from the plugin dir") unless ROOT.join("lib/pandorga/jekyll/plugins/detail_documents.rb").file?
55
+
56
+ redirects = <<~TXT
57
+ /legacy /articles/2026-01-01-welcome/ 301
58
+ /articles/:slug /pages/articles/ 200
59
+ /posts/:slug/ /pages/blog/ 200
60
+ /blog/:slug /pages/blog/ 200
61
+ /projects/:slug /pages/projects/ 200
62
+ /products/* /pages/cv/ 200
63
+ /keep /pages/articles/ 301
64
+ TXT
65
+ stripped = Pandorga::DetailRoutes.strip_splat_rewrites(redirects)
66
+ fail!("splat 200 rewrite survived") if stripped.match?(%r{/(?:articles|posts|blog|projects|products)/(?::slug|\*)})
67
+ fail!("a 301 was stripped with the splats") unless stripped.include?("/legacy /articles/2026-01-01-welcome/ 301")
68
+ fail!("a listing 301 was stripped") unless stripped.include?("/keep /pages/articles/ 301")
69
+
70
+ Dir.mktmpdir("detail-static") do |dir|
71
+ FileUtils.mkdir_p(File.join(dir, "articles", "welcome"))
72
+ File.write(File.join(dir, "articles", "welcome", "index.html"), "<p>welcome</p>")
73
+ fail!("a built detail page must not be rewritten") unless Pandorga::DetailRoutes.static_index?(dir, "/articles/welcome/")
74
+ fail!("a missing detail page must still be rewritten") if Pandorga::DetailRoutes.static_index?(dir, "/articles/missing/")
75
+ end
76
+
77
+ json_ld = ROOT.join("_includes/theme/json-ld.html").read
78
+ fail!("detail pages have no Article schema") unless json_ld.include?('page.schema_type == "Article"')
79
+ fail!("detail pages have no BlogPosting schema") unless json_ld.include?('page.schema_type == "BlogPosting"')
80
+ fail!("detail schema omits datePublished") unless json_ld.include?("datePublished")
45
81
 
46
82
  puts "PASS test-discovery"