al_folio_core 1.0.6 → 1.0.7

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: 72cc440ddce6e0131c852364edaeb57bf3af33199bb68328be63adf6d0e0cb66
4
- data.tar.gz: bea2ce28949a4cc159138a780446acb174b4cd02d532667275c2d1b4ef628f46
3
+ metadata.gz: 06bef68d94bb7ef7fd6665e4aff60909a804ac2f039403dc23af465670735e0b
4
+ data.tar.gz: 4d2d13406b2bdb4e814d5a0b2a07762219e55767f04d4400b5adc2d2d1c9b1ec
5
5
  SHA512:
6
- metadata.gz: fb32157ab9a3d595ee8371fd6b51d8a60492831f067238908ee5ac64127bed0c62038ce31356fd67adbf5faf842cd35a7e372a49f3212c29f9cb30efffc18d89
7
- data.tar.gz: 2d521c401f846d0d45fc551b6be6457753b0f4a9336e442a8166cbbc9445866d124985fdd047bb3a30fadb62964162994c4e4f0c38a54a9c01e0d6e2e1e35590
6
+ metadata.gz: 9be84a54e9353e24a74b0d9618d59d0a6460f216e963694a752ae24b6e10c757e801ee09a86b7885c5d93758e8d12801a1d2513ddbc60a5f6fdec05aba67a887
7
+ data.tar.gz: 2b46a326939e4a12be6ec180cd36756d00bb26ba6e39f4b181a5da73dc38adc1522afae501382a65dd633aece00dc0194d7dba693ad5f33407f5f35a6f7e7949
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.7 - 2026-02-18
4
+
5
+ - Fixed Tocbot active indicator color to use al-folio theme color instead of Tocbot default green.
6
+ - Removed extra custom list rail styling from sidebar TOC to avoid duplicated/misaligned ridges.
7
+ - Added frontmatter-driven TOC collapse controls via `toc.collapse` (`expanded` or `auto`) and optional `toc.collapse_depth`.
8
+
3
9
  ## 1.0.6 - 2026-02-18
4
10
 
5
11
  - Removed unnecessary navbar menu cross-axis alignment to keep the theme toggle vertically aligned with adjacent controls.
@@ -23,20 +23,34 @@
23
23
  <!-- Content -->
24
24
  <div class="container mt-5" role="main">
25
25
  {% if page.toc and page.toc.sidebar %}
26
+ {% assign toc_collapse = page.toc.collapse | default: 'expanded' %}
27
+ {% assign toc_collapse_depth = page.toc.collapse_depth | default: '' %}
26
28
  {% if page.toc.sidebar == 'right' %}
27
29
  <div class="row">
28
30
  <!-- main content area -->
29
31
  <div class="col-sm-9">{{ content }}</div>
30
32
  <!-- sidebar, which will move to the top on a small screen -->
31
33
  <div class="col-sm-3">
32
- <nav id="toc-sidebar" class="sticky-top toc toc-sidebar" aria-label="Table of contents"></nav>
34
+ <nav
35
+ id="toc-sidebar"
36
+ class="sticky-top toc toc-sidebar"
37
+ aria-label="Table of contents"
38
+ data-toc-collapse="{{ toc_collapse }}"
39
+ data-toc-collapse-depth="{{ toc_collapse_depth }}"
40
+ ></nav>
33
41
  </div>
34
42
  </div>
35
43
  {% else %}
36
44
  <div class="row">
37
45
  <!-- sidebar, which will move to the top on a small screen -->
38
46
  <div class="col-sm-3">
39
- <nav id="toc-sidebar" class="sticky-top toc toc-sidebar" aria-label="Table of contents"></nav>
47
+ <nav
48
+ id="toc-sidebar"
49
+ class="sticky-top toc toc-sidebar"
50
+ aria-label="Table of contents"
51
+ data-toc-collapse="{{ toc_collapse }}"
52
+ data-toc-collapse-depth="{{ toc_collapse_depth }}"
53
+ ></nav>
40
54
  </div>
41
55
  <!-- main content area -->
42
56
  <div class="col-sm-9">{{ content }}</div>
@@ -293,20 +293,20 @@ table[data-toggle="table"].af-table-enhanced tbody tr.af-row-selected {
293
293
  }
294
294
 
295
295
  .toc-list {
296
- border-left: 1px solid color-mix(in srgb, var(--global-divider-color) 80%, transparent);
297
296
  list-style: none;
298
- margin: 0.1rem 0;
297
+ margin: 0;
299
298
  padding-left: 0.8rem;
300
299
  }
301
300
 
302
301
  .toc-list .toc-list {
303
302
  margin-top: 0.12rem;
304
- margin-left: 0.4rem;
303
+ margin-left: 0;
305
304
  }
306
305
 
307
306
  .toc-link {
308
307
  color: var(--global-text-color);
309
308
  display: block;
309
+ position: relative;
310
310
  font-size: 0.8rem;
311
311
  line-height: 1.4;
312
312
  margin: 0;
@@ -316,10 +316,18 @@ table[data-toggle="table"].af-table-enhanced tbody tr.af-row-selected {
316
316
  font-weight 0.2s ease;
317
317
  transform: none;
318
318
 
319
+ &::before {
320
+ background-color: color-mix(in srgb, var(--global-divider-color) 80%, transparent) !important;
321
+ }
322
+
319
323
  &:hover {
320
324
  color: var(--global-hover-color);
321
325
  text-decoration: none;
322
326
  transform: none;
327
+
328
+ &::before {
329
+ background-color: var(--global-hover-color) !important;
330
+ }
323
331
  }
324
332
  }
325
333
 
@@ -328,8 +336,16 @@ table[data-toggle="table"].af-table-enhanced tbody tr.af-row-selected {
328
336
  font-weight: 600;
329
337
  transform: none;
330
338
 
339
+ &::before {
340
+ background-color: var(--global-theme-color) !important;
341
+ }
342
+
331
343
  &:hover {
332
344
  color: var(--global-hover-color);
345
+
346
+ &::before {
347
+ background-color: var(--global-hover-color) !important;
348
+ }
333
349
  }
334
350
  }
335
351
  }
data/assets/js/common.js CHANGED
@@ -85,6 +85,21 @@ document.addEventListener("DOMContentLoaded", () => {
85
85
  };
86
86
 
87
87
  if (tocSidebar) {
88
+ const resolveTocCollapseDepth = () => {
89
+ const explicitDepth = Number.parseInt(tocSidebar.dataset.tocCollapseDepth || "", 10);
90
+ if (!Number.isNaN(explicitDepth) && explicitDepth >= 0) {
91
+ return explicitDepth;
92
+ }
93
+
94
+ const collapseMode = (tocSidebar.dataset.tocCollapse || "expanded").toLowerCase();
95
+ if (["auto", "scroll", "true", "collapsed"].includes(collapseMode)) {
96
+ // Keep top-level entries visible and expand nested branches while scrolling.
97
+ return 3;
98
+ }
99
+
100
+ return 6;
101
+ };
102
+
88
103
  document.querySelectorAll(".publications h2").forEach((heading) => {
89
104
  heading.setAttribute("data-toc-skip", "");
90
105
  });
@@ -126,7 +141,7 @@ document.addEventListener("DOMContentLoaded", () => {
126
141
  headingSelector: "h2, h3",
127
142
  ignoreSelector: "[data-toc-skip]",
128
143
  hasInnerContainers: true,
129
- collapseDepth: 6,
144
+ collapseDepth: resolveTocCollapseDepth(),
130
145
  orderedList: false,
131
146
  activeLinkClass: "is-active-link",
132
147
  scrollSmooth: true,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AlFolioCore
4
- VERSION = "1.0.6"
4
+ VERSION = "1.0.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: al_folio_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - al-folio maintainers