Skip to content

Commit

Permalink
fix incorrectly hiding inpage navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Sep 20, 2024
1 parent 01dcfcd commit 18d1cdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layouts/MarkdownLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function createTagLink(tag: string) {
// Generate the nested headings structure
const nestedHeadings = buildNestedHeadings(headings);
const noInPageNavigation = nestedHeadings.length === 0;
---

<script>
Expand Down Expand Up @@ -99,7 +99,7 @@ document.addEventListener("DOMContentLoaded", function () {
</script>

<Layout title={frontmatter.title} drawerIsOpen={true}>
<div class="navbar sticky top-0 bg-base-300 z-20 min-h-[unset] lg:hidden" class:list={[{hidden: headings}]}>
<div class="navbar sticky top-0 bg-base-300 z-20 min-h-[unset] lg:hidden" class:list={[{hidden: noInPageNavigation}]}>
<div class="flex-1">
<!-- <a class="btn btn-ghost btn-sm">daisyUI</a> -->
</div>
Expand Down Expand Up @@ -154,7 +154,7 @@ document.addEventListener("DOMContentLoaded", function () {
</article>
</div>
<div id="md-layout-right" class="w-[30%] sticky top-16 hidden lg:block">
<div class:list={[{hidden: headings}]}>
<div class:list={[{hidden: noInPageNavigation}]}>
<div class="menu menu-xs h-full">
<div id="nav-marker" class="bg-primary"></div>
<ul tabindex="0" id="in-page-nav-container" class="z-[1] p-2 max-h-[80vh] overflow-y-auto border-l-2">
Expand Down

0 comments on commit 18d1cdd

Please sign in to comment.