Add dropdown menu option for landing page

This commit is contained in:
Alex Shpak
2025-09-04 00:17:38 +02:00
parent 564c0b07ad
commit dbaaa516e8
5 changed files with 48 additions and 14 deletions
+24 -13
View File
@@ -41,7 +41,7 @@ img {
@include outline;
}
aside nav ul {
nav ul {
padding: 0;
margin: 0;
list-style: none;
@@ -212,22 +212,33 @@ body[dir="rtl"] .book-menu {
height: 1.5em;
width: 1.5em;
}
> ul {
margin: 0;
padding: 0 $padding-16;
display: flex;
gap: $padding-16;
justify-content: end;
li {
display: inline-block;
}
}
}
.book-layout-landing .book-header {
display: block;
position: relative;
z-index: 1;
nav > ul {
display: flex;
gap: $padding-16;
justify-content: end;
> li {
display: block;
white-space: nowrap;
> ul {
display: none;
position: absolute;
padding: 0;
}
&:hover > ul {
display: block;
}
}
}
}
.book-search {
+12
View File
@@ -43,6 +43,18 @@ enableGitInfo = true
url = "/docs/example/"
weight = 1
[[menu.home]]
name = "Introduction"
url = "/docs/example/"
weight = 10
parent = "Documentation"
[[menu.home]]
name = "Shortcodes"
url = "/docs/shortcodes/badges/"
weight = 20
parent = "Documentation"
[[menu.home]]
name = "Showcases"
url = "/showcases/"
+8
View File
@@ -40,6 +40,14 @@ menu:
- name: "Documentation"
url: "/docs/example/"
weight: 1
- name: "Introduction"
url: "/docs/example/"
weight: 10
parent: "Documentation"
- name: "Shortcodes"
url: "/docs/shortcodes/badges/"
weight: 20
parent: "Documentation"
- name: "Showcases"
url: "/showcases/"
weight: 2
+2 -1
View File
@@ -10,7 +10,8 @@
<ul>
{{ range . }}
<li>
<a href="{{ .URL }}" {{ with .Params.class }}class="{{ . }}"{{ end }} {{ if not .Page }}target="_blank" rel="noopener"{{ end }}>
{{ $local := or (.Page) (strings.HasPrefix .URL "/") }}
<a href="{{ .URL }}" {{ with .Params.class }}class="{{ . }}"{{ end }} {{ if not $local }}target="_blank" rel="noopener"{{ end }}>
{{- .Pre -}}
{{ with .Page }}
{{ partial "docs/title" .Page }}
+2
View File
@@ -9,5 +9,7 @@
{{ end }}
{{ define "header" }}
<nav>
{{ partial "docs/menu-hugo" .Site.Menus.home }}
</nav>
{{ end }}