From f69c7cd513ad099191943f35b5346157b7a1d9d4 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Fri, 1 Mar 2024 10:38:59 -0500 Subject: [PATCH] Fixed logic to hide header - [x] tested when glossary is not enabled - [x] tested when glossary is enabled with summary box - [x] updated glossary.html to set header class for tagetting to hide in summary-box.js - [x] set conditional to hide/display glossary.html partial based on glossary field set in parent _index.md --- themes/digital.gov/layouts/guides/single.html | 4 +- themes/digital.gov/layouts/landings/list.html | 5 +- .../layouts/partials/core/glossary.html | 56 +++++++++---------- themes/digital.gov/src/js/summary-box.js | 2 +- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/themes/digital.gov/layouts/guides/single.html b/themes/digital.gov/layouts/guides/single.html index 8e0b2216f4..cca3374f15 100644 --- a/themes/digital.gov/layouts/guides/single.html +++ b/themes/digital.gov/layouts/guides/single.html @@ -19,7 +19,9 @@ {{- else -}} {{- partial "core/guides/guide-content.html" . -}} {{- end -}} - {{- partial "core/glossary.html" . -}} + {{- if .Parent.Params.glossary -}} + {{- partial "core/glossary.html" . -}} + {{- end -}} {{ end }} diff --git a/themes/digital.gov/layouts/landings/list.html b/themes/digital.gov/layouts/landings/list.html index 89e3110b1a..24558cac62 100644 --- a/themes/digital.gov/layouts/landings/list.html +++ b/themes/digital.gov/layouts/landings/list.html @@ -9,7 +9,6 @@

{{- .Params.title -}}

-
{{- .Content -}} @@ -46,6 +45,8 @@

{{- end -}} {{- partial "core/attribution.html" . -}}

- {{- partial "core/glossary.html" . -}} + {{- if .Parent.Params.glossary -}} + {{- partial "core/glossary.html" . -}} + {{- end -}} {{ end }} diff --git a/themes/digital.gov/layouts/partials/core/glossary.html b/themes/digital.gov/layouts/partials/core/glossary.html index 6bc23ab63b..6893034a04 100644 --- a/themes/digital.gov/layouts/partials/core/glossary.html +++ b/themes/digital.gov/layouts/partials/core/glossary.html @@ -1,31 +1,27 @@ -{{ if ne .Params.glossary nil }} - -{{ end }} + + + + +

Glossary

+ + +
+ +
+ diff --git a/themes/digital.gov/src/js/summary-box.js b/themes/digital.gov/src/js/summary-box.js index cf1a5b7b9d..2158cd8709 100644 --- a/themes/digital.gov/src/js/summary-box.js +++ b/themes/digital.gov/src/js/summary-box.js @@ -10,7 +10,7 @@ const guideSummaryList = guideSummary.querySelector(".usa-list"); const pageHeaders = document.querySelectorAll( - "h2:not(.usa-summary-box__heading, .dg-guide__content-header-title)" + "h2:not(.usa-summary-box__heading, .dg-guide__content-header-title, .dg-glossary__header)" ); function createSummaryBox() {