@access-ci/ui 0.19.0 → 0.20.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.
package/README.md CHANGED
@@ -37,6 +37,7 @@ The library includes functions for rendering common ACCESS user interface compon
37
37
  <div id="universal-menus"></div>
38
38
  <div id="header"></div>
39
39
  <div id="site-menus"></div>
40
+ <div id="breadcrumbs" data-page-title="Page Title"></div>
40
41
  <div id="main" class="container">
41
42
  <div id="body">
42
43
  <h1>Page Title</h1>
@@ -51,6 +52,7 @@ The library includes functions for rendering common ACCESS user interface compon
51
52
  <div id="qa-bot"></div>
52
53
  <script type="module">
53
54
  import {
55
+ breadcrumbs,
54
56
  footer,
55
57
  footerMenus,
56
58
  header,
@@ -116,6 +118,18 @@ The library includes functions for rendering common ACCESS user interface compon
116
118
  target: document.getElementById("site-menus"),
117
119
  });
118
120
 
121
+ // Breadcrumbs example — adapt items to your site's navigation structure
122
+ const breadcrumbTarget = document.getElementById("breadcrumbs");
123
+ const pageTitle = breadcrumbTarget.dataset.pageTitle;
124
+ const breadcrumbItems = [
125
+ { name: "Allocations", href: pageTitle ? "/" : null },
126
+ ];
127
+ if (pageTitle) breadcrumbItems.push({ name: pageTitle });
128
+ breadcrumbs({
129
+ items: breadcrumbItems,
130
+ target: breadcrumbTarget,
131
+ });
132
+
119
133
  tableOfContents({
120
134
  headings: document.querySelectorAll("#body h1, #body h2"),
121
135
  target: document.getElementById("table-of-contents"),