Add dropdown menu option for landing page
This commit is contained in:
+24
-13
@@ -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 {
|
||||
|
||||
@@ -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/"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -9,5 +9,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ define "header" }}
|
||||
<nav>
|
||||
{{ partial "docs/menu-hugo" .Site.Menus.home }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user