use <nav> in header
This commit is contained in:
parent
e4e2844c3e
commit
dbf5a656c2
|
@ -2,21 +2,21 @@
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<a class="site-title" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
<a class="site-title" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||||
|
|
||||||
<ul class="menu">
|
<nav class="menu">
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
<li class="menu-item">
|
<div class="menu-item">
|
||||||
{{ if not .Children }}
|
{{ if not .Children }}
|
||||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a>{{ .Name }}↓</a>
|
<a>{{ .Name }}↓</a>
|
||||||
<ul class="sub-menu">
|
<nav class="sub-menu">
|
||||||
{{ range .Children }}
|
{{ range .Children }}
|
||||||
<li class="menu-item"><a href="{{ .URL }}">{{ .Name }}</a></li>
|
<div class="menu-item"><a href="{{ .URL }}">{{ .Name }}</a></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</nav>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</li>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
@ -259,10 +259,6 @@ body {
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove the unwanted default css in menus */
|
|
||||||
.header ul { list-style: none; margin: 0; padding: 0; }
|
|
||||||
.header li { list-style: none; }
|
|
||||||
|
|
||||||
/* set up spacing of menu items in menu and sub-menu */
|
/* set up spacing of menu items in menu and sub-menu */
|
||||||
.header .menu > * { margin-right: var(--len-3); }
|
.header .menu > * { margin-right: var(--len-3); }
|
||||||
.header .menu > *:last-child { margin-right: 0; }
|
.header .menu > *:last-child { margin-right: 0; }
|
||||||
|
|
Loading…
Reference in a new issue