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
11 changes: 4 additions & 7 deletions assets/css/v2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,11 @@ nav {
.sidebar-layout {
display: flex;
flex-direction: column;
position: relative; /* required for absolute-positioned pseudo element */
position: relative;
z-index: 2;
min-height: 100vh;
min-height: 74vh;
}

/* this is the complete, corrected CSS you can directly copy/paste clearly: */
.sidebar-layout::before {
content: "";
position: absolute;
Expand Down Expand Up @@ -785,9 +784,9 @@ button:has(~ .product-selector[style*="none"]) > .product-selector-button-icon {
padding-top: 1.5rem;
align-items: start;
overflow-y: auto;
overflow-x: hidden;
color: var(--color-foreground);

/* Reset/Renormalize lists to remove default browser styling */
.sidebar__container,
.sidebar__container button,
.sidebar__container ul,
Expand Down Expand Up @@ -1481,10 +1480,8 @@ a:has(code:not(pre code)) {
padding: 0.15rem 0.5rem;
font-size: 0.75rem;
z-index: 999;
/* position: absolute; */
background-color: white;
margin: 0 0 -1px 0;
/* box-shadow: 2px 2px 0px var(--color-shadow); */
}

.code-container {
Expand Down Expand Up @@ -1636,7 +1633,7 @@ hr {
background-repeat: no-repeat;
background-size: contain;
background-position: left center;
width: 200px; /* Adjust the width as needed to fit the logo */
width: 200px;

img {
display: none;
Expand Down
16 changes: 0 additions & 16 deletions assets/js/sidebar-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,3 @@ document.addEventListener('click', (e) => {
}
}
});

document.addEventListener('DOMContentLoaded', () => {
const sidebar = document.querySelector('.sidebar__ul');

if (!sidebar) return;

const activeLink = sidebar.querySelector('.sidebar__link--current');

if (activeLink) {
activeLink.scrollIntoView({
behavior: 'auto',
block: 'center',
inline: 'nearest',
});
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
description: Nesting-1b
title: Nesting-1b
---

1b has some content, but also some nested stuff.
This should cause an overview page to render.
30 changes: 15 additions & 15 deletions layouts/partials/sidebar-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
{{ $currentPage := .currentPage }}
{{ $firstSection := .firstSection }}
{{ $idPrefix := .idPrefix }}

{{ with $firstSection }}
<ul class="sidebar__ul">
{{ $pages := .Pages.ByWeight }}
{{ range $index, $p := $pages }}
{{- $onPage := eq $currentUrl $p.Permalink -}}
{{- $isAncestor := $p.IsAncestor $currentPage -}}
{{- $shouldExpand := or $onPage $isAncestor -}}
{{/* These variables are used to create a unique id to be attached to every link
that accessibility users can correctly "Skip Table Of Contents" */}}
{{- $sectionID := printf "%ssection-%s" $idPrefix (urlize $p.Permalink) -}}
{{- $linkID := printf "%slink-%s" $idPrefix (urlize $p.Permalink) -}}
{{- $nextIndex := add $index 1 -}}
{{- $nextLink := index $pages $nextIndex -}}

{{ if eq $p.Kind "section" }}
<li class="sidebar__section">
<button
Expand All @@ -35,6 +31,20 @@
class="sidebar__children"
{{ if not $shouldExpand }}hidden{{ end }}
>
{{ if and .Content (gt (len .Pages) 0) }}
<ul>
<li class="sidebar__page">
<a
href="{{ $p.Permalink }}"
class="sidebar__link {{ if $onPage }}sidebar__link--current{{ end }}"
{{ if $onPage }}aria-current="page"{{ end }}
>
Overview
</a>
</li>
</ul>
{{ end }}

{{ partial "sidebar-list.html" (dict
"firstSection" $p
"currentUrl" $currentUrl
Expand All @@ -43,7 +53,6 @@
) }}
</div>
</li>

{{ else if eq $p.Kind "page" }}
{{- $tocHasItems := (in $p.TableOfContents "<li>") -}}
{{- $pageHasTOC := (and $onPage $tocHasItems $p.Params.toc) -}}
Expand Down Expand Up @@ -82,15 +91,6 @@
{{ end }}
</li>
{{ end }}

{{ end }}
</ul>
{{ end }}

{{/* {{ if gt (.WordCount) 0 }}
<ul>
<li>
<a href="{{ .Permalink }}" style="color: purple; {{if $onPage}}font-weight: bold;{{end}}">{{ .Title }} - Overview</a>
</li>
</ul>
{{ end }} */}}
{{ end }}
Loading