Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/scss/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
display: none;

&.expanded {
display: block;
display: block !important;
}
}

Expand Down
12 changes: 8 additions & 4 deletions layouts/shortcodes/blocks/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
{{ end }}


<div class="{{$cardClass}} d-flex align-items-stretch">
<div class="{{$cardClass}} d-flex align-items-stretch">
{{ if $sectionLink }}
{{ with .Site.GetPage (printf "%s%s" (.Scratch.Get "docsRoot") $sectionLink) }}
<a href="{{ .RelPermalink }}" class="homepage-card homepage-card__sectionLink homepage-card__hasIcon homepage-card__icon{{ title $iconPosition }}">
<div class="homepage-card__icon">
{{ readFile (printf "%s%s" .RelPermalink .Params.icon) | safeHTML }}
{{ $svgContent := readFile (printf "%s%s" .RelPermalink .Params.icon) }}
{{ $modifiedSvg := replaceRE `(<svg)(.*?>)` "$1 aria-hidden=\"true\"$2" $svgContent 1 }}
{{ $modifiedSvg | safeHTML }}
</div>
<h4 class="homepage-card__title">{{ .Title }}</h4>
{{ if $description }}
Expand All @@ -46,9 +48,11 @@ <h4 class="homepage-card__title">{{ .Title }}</h4>
{{ if $icon }}
<div class="homepage-card__icon">
{{ if eq (index (last 1 (split $icon ".")) 0) "svg" }}
{{ readFile $icon | safeHTML }}
{{ $svgContent := readFile $icon }}
{{ $modifiedSvg := replaceRE `(<svg)(.*?>)` "$1 aria-hidden=\"true\"$2" $svgContent 1 }}
{{ $modifiedSvg | safeHTML }}
{{ else }}
<img src="{{ $icon }}" />
<img src="{{ $icon }}" aria-hidden="true"/>
{{ end }}
</div>
{{ end }}
Expand Down
5 changes: 3 additions & 2 deletions layouts/shortcodes/embedded-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{{ $height := .Get "height" }}
{{ $id := urlize (humanize (replace (delimit (last 1 (split $src "/")) "") "." "-")) }}
{{ $caption := .Get "caption" }}
{{ $noalt := .Get "noalt" }}

<div class="{{ if $no_border }}embedded-image_noborder{{ else }}embedded-image{{ end }}{{ if $caption }} hasCaption{{ end }}" data-toggle="modal" data-bs-toggle="modal" data-target="#{{ $id }}" data-bs-target="#{{ $id }}">

Expand All @@ -19,7 +20,7 @@
</video>

{{ else }}
<img src="{{ $src }}" alt="{{ $alt }}"{{ if $width }} width="{{ $width }}"{{ end }}{{ if $height }} height="{{ $height }}"{{ end }} />
<img src="{{ $src }}" alt="{{ $alt }}"{{ if $width }} width="{{ $width }}"{{ end }}{{ if $height }} height="{{ $height }}"{{ end }} {{ if $noalt }} aria-hidden=”true” data-proofer-ignore {{ end }} />
{{ end }}

{{ if $caption }}
Expand All @@ -37,7 +38,7 @@
<p>{{ if $alt }}Description: {{ $alt }}. {{ end }}Your browser does not support the video tag.</p>
</video>
{{ else }}
<img src="{{ $src }}" alt="{{ $alt }}" />
<img src="{{ $src }}" alt="{{ $alt }}" {{ if $noalt }} aria-hidden=”true” data-proofer-ignore {{ end }}/>
{{ end }}
</div>
</div>
11 changes: 9 additions & 2 deletions static/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});

Expand Down