diff --git a/assets/scss/menu.scss b/assets/scss/menu.scss index ba6519f..5542b27 100644 --- a/assets/scss/menu.scss +++ b/assets/scss/menu.scss @@ -154,7 +154,7 @@ display: none; &.expanded { - display: block; + display: block !important; } } diff --git a/layouts/shortcodes/blocks/card.html b/layouts/shortcodes/blocks/card.html index 191fef9..aab43f8 100644 --- a/layouts/shortcodes/blocks/card.html +++ b/layouts/shortcodes/blocks/card.html @@ -26,12 +26,14 @@ {{ end }} -
+
{{ if $sectionLink }} {{ with .Site.GetPage (printf "%s%s" (.Scratch.Get "docsRoot") $sectionLink) }}
- {{ readFile (printf "%s%s" .RelPermalink .Params.icon) | safeHTML }} + {{ $svgContent := readFile (printf "%s%s" .RelPermalink .Params.icon) }} + {{ $modifiedSvg := replaceRE `()` "$1 aria-hidden=\"true\"$2" $svgContent 1 }} + {{ $modifiedSvg | safeHTML }}

{{ .Title }}

{{ if $description }} @@ -46,9 +48,11 @@

{{ .Title }}

{{ if $icon }}
{{ if eq (index (last 1 (split $icon ".")) 0) "svg" }} - {{ readFile $icon | safeHTML }} + {{ $svgContent := readFile $icon }} + {{ $modifiedSvg := replaceRE `()` "$1 aria-hidden=\"true\"$2" $svgContent 1 }} + {{ $modifiedSvg | safeHTML }} {{ else }} - + {{ end }}
{{ end }} diff --git a/layouts/shortcodes/embedded-image.html b/layouts/shortcodes/embedded-image.html index f18f101..2bee881 100644 --- a/layouts/shortcodes/embedded-image.html +++ b/layouts/shortcodes/embedded-image.html @@ -6,6 +6,7 @@ {{ $height := .Get "height" }} {{ $id := urlize (humanize (replace (delimit (last 1 (split $src "/")) "") "." "-")) }} {{ $caption := .Get "caption" }} +{{ $noalt := .Get "noalt" }}
@@ -19,7 +20,7 @@ {{ else }} -{{ $alt }} +{{ $alt }} {{ end }} {{ if $caption }} @@ -37,7 +38,7 @@

{{ if $alt }}Description: {{ $alt }}. {{ end }}Your browser does not support the video tag.

{{ else }} -{{ $alt }} +{{ $alt }} {{ end }}
\ No newline at end of file diff --git a/static/js/menu.js b/static/js/menu.js index d0d8bba..33417b6 100644 --- a/static/js/menu.js +++ b/static/js/menu.js @@ -11,15 +11,22 @@ $(document).ready(function () { menu.removeClass("init"); $(".gd-docs-menu-page__toggle-btn").on("click", function() { - console.log("clicked"); var $button = $(this); - var $section = $("#" + $button.attr("aria-controls")); + var sectionId = $button.attr("aria-controls"); + var $section = $("#" + sectionId); var isExpanded = $button.attr("aria-expanded") === "true"; + // Update button state $button.attr("aria-expanded", !isExpanded); $button.attr("aria-label", (isExpanded ? "Expand" : "Collapse") + " " + $button.closest(".gd-docs-menu-page__title").find(".gd-docs-menu-page__link").text() + " section"); + // Fallback: if section not found by ID, look for the next sibling wrapper + if ($section.length === 0) { + $section = $button.closest(".gd-docs-menu-page__title").next(".gd-docs-menu-section-wrapper"); + } + + // Toggle expanded state $section.toggleClass("expanded"); });