pandorga 2.0.0 → 2.0.1

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: 96a7bd991685c2ae92de18f572112e692d02b211e134be12f0838247da013ade
4
- data.tar.gz: 3f23ff94186ed6931a4f947efd18858cb16908a7db3c294a0eb9d92e244fc6f6
3
+ metadata.gz: 8ae9f3cb8f8c39b2e9af7ee8b582a35cdc389f61302704888d3c85adb88de394
4
+ data.tar.gz: 0d313d288d44e2d249751ceda633d6f58d981c42561a116c3faad0aac8e2cd9b
5
5
  SHA512:
6
- metadata.gz: 8e924c057f9e70fdbea5e2b5ca40c3499ee18d482ce580ab091ff72e368bd4fc931c5ef7fb4a099155c04328a2ac2d98c93a36d5c3f1c0961e998c3e1a9edeb5
7
- data.tar.gz: e8c7c19029b08a5cd20c6f5c109872b40c2d26877ffa8946ae01b6ab5c2d0c53dc6aad0eae0adf65ba23003fca69f18942dc3171e82ce44f7f7513d97c286ec4
6
+ metadata.gz: 91f82a29a1d5b7890fc2955ba3522d35f5c992a57dfda3b2f6e815e7ca613278aa1910be945170351d82ce5675045994070c6a6c8e9a8e20c3bf8d7b2448736d
7
+ data.tar.gz: 7478438f607e96460805455bf6873b0a97ccf35804a215f0d5422a168eb91228a91ef6907d9240b8d63f173e1cebc031c45070d0c8dfa4ae09b3ab8bf05ac088
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.0.1] — 2026-10-24
6
+
7
+ ### Fixed
8
+
9
+ - Home article cards set their tags and "Read" on one row, like the featured card, and every card's top rule uses the Articles accent instead of rotating through the palette, which drew the second card in the secondary hue (PLT-AC-52).
10
+ - A home band header whose kicker, title and note are all saved empty is removed with its rule instead of leaving an empty ruled strip; the band keeps an `aria-label` (PLT-AC-52).
11
+
5
12
  ## [2.0.0] — 2026-10-24
6
13
 
7
14
  ### Added
@@ -275,10 +275,14 @@
275
275
  html += '<p class="ledger-card-copy font-body">' +
276
276
  escapeHtml(f.preview) + '</p>';
277
277
  }
278
- html += renderTagChips(f.tags, { hrefFor: options.tagHref, limit: options.tagLimit });
278
+ var chips = renderTagChips(f.tags, { hrefFor: options.tagHref, limit: options.tagLimit });
279
+ // `tagsInFoot` sets the chips on the call to action's row, as the home
280
+ // featured card does (PLT-AC-52); otherwise they sit above the foot.
281
+ if (!options.tagsInFoot) html += chips;
279
282
  // The meta strip above already carries the date, so the footer copy is
280
283
  // opt-in rather than the default — printing it twice is the common bug.
281
284
  var foot = '';
285
+ if (options.tagsInFoot) foot += chips;
282
286
  if (options.showFooterDates) {
283
287
  foot += renderCardFooterDates(f.date, f.lastUpdated, locale);
284
288
  }
@@ -431,6 +431,13 @@
431
431
  ['green', 'ochre'].forEach(function (name) {
432
432
  band.classList.toggle('page-accent--' + name, accent === name);
433
433
  });
434
+ /* A header left with no text and no link goes with its rule, and the
435
+ * band keeps a name from its data-home-label (PLT-AC-52). */
436
+ if (!root.querySelector('[data-content-section-kicker], [data-content-section-title], [data-content-section-note], .home-section-aside')) {
437
+ var label = band.getAttribute('data-home-label');
438
+ if (label && !band.hasAttribute('aria-label')) band.setAttribute('aria-label', label);
439
+ root.remove();
440
+ }
434
441
  }
435
442
 
436
443
  function yieldToMain() {
@@ -2,14 +2,35 @@
2
2
  Grouped index band (sources / network / bibliography). Expects `band` with
3
3
  kind=index and a pages array from PandorgaRegistry.home_bands.
4
4
  {%- endcomment -%}
5
+ {%- comment -%}
6
+ The band's name when its header is gone: the panels' default titles. A
7
+ header whose kicker, title and note are all blank in headers.yml is not
8
+ emitted at all, so no empty ruled strip is left (PLT-AC-52).
9
+ {%- endcomment -%}
10
+ {%- assign _band_label = "" -%}
11
+ {%- for panel in band.pages -%}
12
+ {%- assign _label_page = site.pages | where: "key", panel.key | first -%}
13
+ {%- assign _label = panel.title | default: _label_page.title | default: panel.key -%}
14
+ {%- if _band_label != "" -%}{%- assign _band_label = _band_label | append: ", " -%}{%- endif -%}
15
+ {%- assign _band_label = _band_label | append: _label -%}
16
+ {%- endfor -%}
17
+ {%- assign _hide_banner = false -%}
18
+ {%- if site.data.page_headers -%}
19
+ {%- assign _band_head = site.data.page_headers[band.section_key] -%}
20
+ {%- assign _band_text = _band_head.kicker | append: _band_head.title | append: _band_head.note | strip -%}
21
+ {%- if _band_text == "" -%}{%- assign _hide_banner = true -%}{%- endif -%}
22
+ {%- endif -%}
5
23
  <section
6
24
  id="home-{{ band.group }}"
7
25
  class="home-band home-band--contrast home-band--index"
8
26
  data-home-band
9
27
  data-home-kind="index"
10
28
  data-home-group="{{ band.group }}"
29
+ data-home-label="{{ _band_label | escape }}"
30
+ {%- if _hide_banner %} aria-label="{{ _band_label | escape }}"{% endif %}
11
31
  >
12
32
  <div class="home-band-inner">
33
+ {%- unless _hide_banner -%}
13
34
  <div class="ledger-section-banner" data-content-home-section="{{ band.section_key }}">
14
35
  <div class="ledger-section-lead">
15
36
  <span class="ledger-kicker" data-content-section-kicker></span>
@@ -17,6 +38,7 @@
17
38
  <p class="home-section-note font-body" data-content-section-note></p>
18
39
  </div>
19
40
  </div>
41
+ {%- endunless -%}
20
42
  <div class="home-index-split">
21
43
  {%- for panel in band.pages -%}
22
44
  {%- assign _panel_page = site.pages | where: "key", panel.key | first -%}
data/_layouts/home.html CHANGED
@@ -483,6 +483,7 @@ layout: shell
483
483
  locale: locale,
484
484
  ctaLabel: 'Read',
485
485
  tagHref: articleTagHref,
486
+ tagsInFoot: true,
486
487
  metaParts: [runtime.formatDate(entry.date, locale)]
487
488
  });
488
489
  }, 'Articles could not be loaded right now.');
@@ -763,26 +763,23 @@ html[data-theme="light"] .home-hero-plate {
763
763
  display: none;
764
764
  }
765
765
 
766
+ /* Tags and "Read" share the last row, as on the featured card (PLT-AC-52). */
766
767
  .home-card-grid .ledger-card-foot {
767
- justify-content: flex-end;
768
+ justify-content: space-between;
769
+ }
770
+
771
+ .home-card-grid .ledger-card-foot .ledger-cta {
772
+ margin-left: auto;
768
773
  }
769
774
 
770
- /* A top rule per card, rotating through the palette triad, is what gives the
771
- grid its ledger rhythm in the mockup. */
775
+ /* Every card's top rule is the band accent, which `page-accent--<accent>`
776
+ sets on the section (PLT-AC-52). */
772
777
  .home-card-grid .ledger-card {
773
778
  border-top-width: 2px;
774
779
  border-top-style: solid;
775
780
  border-top-color: var(--color-primary);
776
781
  }
777
782
 
778
- .home-card-grid .ledger-card:nth-child(2) {
779
- border-top-color: var(--color-secondary);
780
- }
781
-
782
- .home-card-grid .ledger-card:nth-child(3) {
783
- border-top-color: var(--color-tertiary);
784
- }
785
-
786
783
  /* ── Rascunhos: dropped sheets ──
787
784
  Four compact cards rather than four full-width text rows: the poster is
788
785
  visible at every breakpoint now (it used to hide below 640px), each card
@@ -24,7 +24,7 @@ module Pandorga
24
24
 
25
25
  gem "pandorga", "~> 2.0"
26
26
  # Local checkout: gem "pandorga", path: "../pandorga"
27
- # GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.0.0"
27
+ # GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.0.1"
28
28
  gem "csv"
29
29
  gem "base64"
30
30
  RUBY
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pandorga
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # PLT-AC-52. Home article cards keep tags and "Read" on one row, all use the
5
+ # band accent, and a band header whose texts are all empty is removed.
6
+
7
+ require "pathname"
8
+
9
+ ROOT = Pathname.new(__dir__).join("..", "..").expand_path
10
+
11
+ def fail!(message)
12
+ warn "FAIL test-home-article-cards: #{message}"
13
+ exit 1
14
+ end
15
+
16
+ blocks = ROOT.join("_includes/content-runtime/43-blocks.html").read
17
+ home_layout = ROOT.join("_layouts/home.html").read
18
+ css = ROOT.join("assets/css/ledger/home.css").read
19
+ band_index = ROOT.join("_includes/home/band-index.html").read
20
+ fragments = ROOT.join("_includes/content-runtime/60-fragments.html").read
21
+
22
+ # 1. Foot row.
23
+ card = blocks[/function renderArchiveCard\(.*?\n \}\n/m] or fail!("renderArchiveCard not found")
24
+ fail!("renderArchiveCard has no tagsInFoot option") unless card.include?("options.tagsInFoot")
25
+ chips_at = card.index("renderTagChips(")
26
+ foot_at = card.index("'<div class=\"ledger-card-foot\">'")
27
+ fail!("tag chips are not built before the foot") unless chips_at && foot_at && chips_at < foot_at
28
+ fail!("chips are not put inside the foot when tagsInFoot") unless card =~ /tagsInFoot[^\n]*\n?[^\n]*foot\s*\+?=\s*chips|foot\s*=\s*\(?options\.tagsInFoot/m
29
+ callers = Dir[ROOT.join("{_layouts,_includes}/**/*.html").to_s].select { |f| File.read(f).include?("tagsInFoot: true") }
30
+ fail!("tagsInFoot must be set by the home layout only, found #{callers.inspect}") unless callers.map { |f| File.basename(f) } == ["home.html"]
31
+ foot_rule = css[/^\.home-card-grid \.ledger-card-foot \{[^}]*\}/m] or fail!("no .home-card-grid .ledger-card-foot rule")
32
+ fail!(".home-card-grid .ledger-card-foot must space-between") unless foot_rule.include?("justify-content: space-between")
33
+ cta_rule = css[/^\.home-card-grid \.ledger-card-foot \.ledger-cta \{[^}]*\}/m]
34
+ fail!(".home-card-grid .ledger-card-foot .ledger-cta must take margin-left: auto") unless cta_rule&.include?("margin-left: auto")
35
+
36
+ # 2. One accent.
37
+ css.scan(/^([^{}\n]*\.home-card-grid[^{}\n]*)\{([^}]*)\}/m).each do |sel, body|
38
+ if body =~ /border-top-color:\s*var\(--color-(secondary|tertiary)\)/
39
+ fail!("#{sel.strip} rotates the card rule to --color-#{$1}")
40
+ end
41
+ fail!("#{sel.strip} keys a colour to :nth-child") if sel.include?("nth-child") && body =~ /color/
42
+ end
43
+ base = css[/^\.home-card-grid \.ledger-card \{[^}]*\}/m] or fail!("no .home-card-grid .ledger-card rule")
44
+ fail!("card top rule is not var(--color-primary)") unless base.include?("border-top-color: var(--color-primary)")
45
+
46
+ # 3. Build time.
47
+ fail!("band-index does not set data-home-label") unless band_index.include?("data-home-label=")
48
+ fail!("band-index does not guard the banner on empty header texts") unless band_index =~ /\{%-?\s*unless _hide_banner\s*-?%\}\s*<div class="ledger-section-banner"/m
49
+ fail!("band-index does not label the section when the banner is hidden") unless band_index =~ /_hide_banner\s*%\}\s*aria-label=/
50
+
51
+ # 4. Runtime.
52
+ apply = fragments[/function applyHomeSection\(.*?\n \}\n/m] or fail!("applyHomeSection not found")
53
+ fail!("applyHomeSection does not drop an emptied banner") unless apply.include?("root.remove()") &&
54
+ apply.include?("home-section-aside") && apply.include?("data-home-label")
55
+
56
+ puts "PASS test-home-article-cards"
data/scripts/validate.sh CHANGED
@@ -77,6 +77,7 @@ TESTS=(
77
77
  scripts/test/test-timeline-pan.rb
78
78
  scripts/test/test-v3-layout.rb
79
79
  scripts/test/test-studio-section-texts.rb
80
+ scripts/test/test-home-article-cards.rb
80
81
  )
81
82
 
82
83
  failed=0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandorga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Pandorga contributors
@@ -439,6 +439,7 @@ files:
439
439
  - scripts/test/test-hero-portraits.rb
440
440
  - scripts/test/test-hero-summary.rb
441
441
  - scripts/test/test-highlighter-pills.rb
442
+ - scripts/test/test-home-article-cards.rb
442
443
  - scripts/test/test-home-articles.rb
443
444
  - scripts/test/test-home-band-art.rb
444
445
  - scripts/test/test-home-band-intro.rb