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 docs/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ partial "navbar.html" . }}
</header>
<div class="container-fluid td-default td-outer">
<main role="main" class="td-main" aria-label="Article content">
<main id="main-content" role="main" class="td-main" aria-label="Article content">
{{ block "main" . }}{{ end }}
</main>
{{ partialCached "footer.html" . }}
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="d-none d-xl-block col-xl-2 td-toc d-print-none">
{{ partial "toc.html" . }}
</div>
<main class="col-12 col-lg-8 col-xl-7 pl-lg-5 ps-lg-5" role="main" aria-label="Article content">
<main id="main-content" class="col-12 col-lg-8 col-xl-7 pl-lg-5 ps-lg-5" role="main" aria-label="Article content">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ if .Draft }}
Expand Down
4 changes: 2 additions & 2 deletions docs/layouts/partials/navbar-version-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
{{ $.Scratch.Set "activeVersion" .version }}
{{ end }}
{{ end }}
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ printf "%s" ($.Scratch.Get "docLabel") }}
</a>
</button>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
{{ range .Site.Params.versions }}
<a
Expand Down
94 changes: 94 additions & 0 deletions docs/layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{{/* (C) 2023 GoodData Corporation */}}
<button type="button" id="gd-docs-menu__mobile-trigger" class="gd-docs-menu__mobile-btn" aria-expanded="false" aria-controls="gd-docs-menu" aria-label="Toggle navigation menu">
<span class="gd-docs-menu__mobile-icon" aria-hidden="true"></span>
</button>
<div class="gd-docs-menu__mobile-bg"></div>
<nav id="gd-docs-menu" class="gd-docs-menu init" aria-label="Articles">
{{ if .Site.Params.versions }}
{{ partial "navbar-version-selector.html" . }}
{{ end }}

{{ partial "sidebar-tree.html" . }}
</nav>

{{ define "root-link" }}
{{ $isCurrent := eq .currentPage .root.FirstSection }}
{{ $active := .active }}
{{ with .root }}
<ul class="gd-docs-menu-section gd-docs-menu-section__root">
<li class="gd-docs-menu-page{{ if or $isCurrent $active }} active{{ end }}">
<div class="gd-docs-menu-page__title">
<a href="{{ .RelPermalink }}" class="gd-docs-menu-page__link">{{ .LinkTitle }}</a>
</div>
</li>
</ul>
{{ end }}
{{ end }}

{{ define "section-tree-nav-sections" }}
{{ $root := .root }}
{{ $site := .site }}
{{ $currentPage := .currentPage }}
{{ $firstInSection := (index $root 0) }}
{{ $isRootSection := eq $firstInSection.Parent .site.Home }}

{{ if gt (len (where $root.ByWeight "Params.toc_hide" "ne" true)) 0 }}

<ul class="gd-docs-menu-section{{ if .activeSection }} active{{ end }}">
{{ range $page := $root.ByWeight }}
{{ $page := $page.Page }}
{{ $pageId := replace (replaceRE "^/|/$" "" $page.RelPermalink) "/" "_" }}

{{ if and (not (eq $page.Params.toc_hide true)) (not (eq $page $site.Home)) }}
{{ $activePage := eq $page $currentPage }}
{{ $activeSection := or $activePage ($currentPage.IsDescendant $page) }}
{{ $pageId := replace (replaceRE "^/|/$" "" $page.RelPermalink) "/" "_" }}

<li class="gd-docs-menu-page{{ if $activePage }} active{{ end }}{{ if $page.Params.navSeparator }} gd-docs-menu-page__separator{{ end }}">
{{ if $page.Params.navigationLabel }}
<span class="gd-docs-menu-page__label">{{ $page.LinkTitle }}</span>
{{ else }}
<div class="gd-docs-menu-page__title">
{{ if $page.Params.externalLink }}
<a href="{{ $page.Params.externalLink }}" class="gd-docs-menu-page__link" target="_blank">{{ $page.LinkTitle }}</a>
{{ else }}
<a href="{{ $page.Permalink }}" class="gd-docs-menu-page__link">{{ $page.LinkTitle }}</a>
{{ end }}

{{ if $page.Pages }}
<button
type="button"
id="btn-{{ $pageId }}"
class="gd-docs-menu-page__toggle-btn"
aria-expanded="{{ if $activeSection }}true{{ else }}false{{ end }}"
aria-controls="section-{{ $pageId }}"
aria-label="{{ if $activeSection }}Collapse{{ else }}Expand{{ end }} {{ $page.LinkTitle }} section">
<span class="gd-docs-menu-page__chevron">
{{ with resources.Get "icons/chevron-menu.svg" }}
{{ $svg := . | minify }}
{{ $svg := replace $svg.Content "<svg " "<svg aria-hidden=\"true\" focusable=\"false\" " }}
{{ $svg | safeHTML }}
{{ end }}
</span>
</button>
{{ end }}
</div>

{{ if $page.Pages }}
<div id="section-{{ $pageId }}" class="gd-docs-menu-section-wrapper{{ if $activeSection }} expanded{{ end }}">
{{ template "section-tree-nav-sections" (dict "root" $page.Pages "currentPage" $currentPage "activeSection" $activeSection "site" $site) }}
</div>
{{ end }}
{{ end }}
</li>

{{ if and $page.Params.navigationLabel $page.Pages }}
<li class="gd-docs-menu-page">
{{ template "section-tree-nav-sections" (dict "root" $page.Pages "currentPage" $currentPage "activeSection" $activeSection "site" $site) }}
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ end }}
2 changes: 2 additions & 0 deletions docs/layouts/partials/skip-links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{/* (C) 2023 GoodData Corporation */}}
<div class="skip-links"></div>
Loading