home/layouts/partials/docs/menu.html

71 lines
2 KiB
HTML
Raw Permalink Normal View History

2024-11-10 00:33:32 +00:00
<nav>
2024-11-10 14:26:52 +00:00
{{ partial "docs/brand" . }}
{{ partial "docs/search" . }}
2024-11-10 00:33:32 +00:00
2024-11-10 14:26:52 +00:00
<div class="book-menu-top">
{{ partial "docs/inject/menu-before" . }}
2024-11-17 23:43:03 +00:00
<h4><u>{{ partial "docs/menu-hugo" .Site.Menus.before }}</u></h4>
2024-11-10 14:26:52 +00:00
</div>
2024-11-10 00:33:32 +00:00
2024-11-10 14:26:52 +00:00
<div class="book-menu-mid">
2024-11-17 23:43:03 +00:00
<!-- Portfolio Section -->
<div class="menu-section">
<h4 class="toggle-section" data-target="portfolio-section">
<u>portfolio</u> <span class="arrow"></span>
</h4>
<div id="portfolio-section" class="section-content">
{{ if .Site.Params.BookMenuBundle }}
{{ partial "docs/menu-bundle" . }}
{{ else }}
{{ partial "docs/menu-filetree" . }}
{{ end }}
</div>
</div>
<!-- Writing Section -->
<div class="menu-section">
<h4 class="toggle-section" data-target="writing-section">
<u>writing</u> <span class="arrow"></span>
</h4>
<div id="writing-section" class="section-content">
{{ partial "docs/menu-hugo" .Site.Menus.after }}
</div>
</div>
2024-11-10 14:26:52 +00:00
</div>
2024-11-10 00:33:32 +00:00
2024-11-17 23:43:03 +00:00
2024-11-10 14:26:52 +00:00
<div class="book-menu-bot">
{{ partial "docs/inject/menu-after" . }}
2024-11-17 23:43:03 +00:00
{{ partial "docs/menu-hugo" .Site.Menus.contact }}
2024-11-10 14:26:52 +00:00
</div>
2024-11-10 00:33:32 +00:00
</nav>
<!-- Restore menu position as soon as possible to avoid flickering -->
{{ $script := resources.Get "menu-reset.js" | resources.Minify }}
2024-11-17 23:43:03 +00:00
<!---->
2024-11-10 00:33:32 +00:00
{{ with $script.Content }}
<script>{{ . | safeJS }}</script>
2024-11-17 23:43:03 +00:00
<script>
document.addEventListener("DOMContentLoaded", () => {
const toggleSections = document.querySelectorAll(".toggle-section");
toggleSections.forEach((toggle) => {
toggle.addEventListener("click", () => {
const targetId = toggle.getAttribute("data-target");
const section = document.getElementById(targetId);
const arrow = toggle.querySelector(".arrow");
if (section.classList.contains("open")) {
section.classList.remove("open");
arrow.classList.remove("up");
} else {
section.classList.add("open");
arrow.classList.add("up");
}
});
});
});
</script>
2024-11-10 00:33:32 +00:00
{{ end }}