aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-27 23:05:50 +0100
committerJulien Dessaux2023-01-27 23:05:50 +0100
commit6ad4e164af37e6fe90283a4b9b124c03057d3805 (patch)
tree2303d0c190d73ab69783718892fbf050f6821baa /layouts
parentImprove link target size on mobile (lighthouse) (diff)
downloadwww-6ad4e164af37e6fe90283a4b9b124c03057d3805.tar.gz
www-6ad4e164af37e6fe90283a4b9b124c03057d3805.tar.bz2
www-6ad4e164af37e6fe90283a4b9b124c03057d3805.zip
Update nav menu css
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html3
-rw-r--r--layouts/_default/baseof.html3
-rw-r--r--layouts/partials/nav.html37
3 files changed, 18 insertions, 25 deletions
diff --git a/layouts/404.html b/layouts/404.html
index 31808d1..c0242ed 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -15,7 +15,8 @@
{{- $header := resources.Get "header.css" -}}
{{- $home := resources.Get "home.css" -}}
{{- $pagination := resources.Get "pagination.css" -}}
- {{- $allCss := slice $base $code $footer $header $home $pagination | resources.Concat "static/all.css" | fingerprint | minify -}}
+ {{- $responsive := resources.Get "responsive.css" -}}
+ {{- $allCss := slice $base $code $footer $header $home $pagination $responsive | resources.Concat "static/all.css" | fingerprint | minify -}}
<link rel="stylesheet" href="{{ $allCss.Permalink }}">
{{ range .AlternativeOutputFormats -}}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 201d609..c05ed38 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -15,7 +15,8 @@
{{- $header := resources.Get "header.css" -}}
{{- $home := resources.Get "home.css" -}}
{{- $pagination := resources.Get "pagination.css" -}}
- {{- $allCss := slice $base $code $footer $header $home $pagination | resources.Concat "static/all.css" | fingerprint | minify -}}
+ {{- $responsive := resources.Get "responsive.css" -}}
+ {{- $allCss := slice $base $code $footer $header $home $pagination $responsive | resources.Concat "static/all.css" | fingerprint | minify -}}
<link rel="stylesheet" href="{{ $allCss.Permalink }}">
{{ range .AlternativeOutputFormats -}}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 5abfc6f..9a63b34 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,29 +1,13 @@
<header>
<nav>
- <ul>
- <li class="nav-menu-title{{if .IsHome}} nav-menu-active{{end}}"><a href="/">{{ .Site.Title }}</a></li>
- <li>
- <select id="themes" class="nav-menu-magin-left" onchange="setTheme()">
- <option value="black-theme">Black</option>
- <option value="dark-theme">Dark</option>
- <option value="light-theme">Light</option>
- </select>
+ <ol>
+ <li id="title"{{if .IsHome}} class="nav-menu-active"{{end}}>
+ <a href="/">{{ .Site.Title }}</a>
</li>
+ </ol>
+ <ol id="nav-menu">
{{- $p := . -}}
-
- {{- range first 1 .Site.Menus.main.ByWeight -}}
- {{- $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
- {{- with .Page -}}
- {{- $active = or $active ( $.IsDescendant .) -}}
- {{- end -}}
- {{- $url := urls.Parse .URL -}}
- {{- $baseurl := urls.Parse $.Site.Params.Baseurl -}}
- <li class="nav-menu-margin-left{{if $active }} nav-menu-active{{end}}">
- <a href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"{{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a>
- </li>
- {{ end }}
-
- {{- range after 1 .Site.Menus.main.ByWeight -}}
+ {{- range .Site.Menus.main.ByWeight -}}
{{- $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
{{- with .Page -}}
{{- $active = or $active ( $.IsDescendant .) -}}
@@ -34,6 +18,13 @@
<a href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"{{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a>
</li>
{{ end }}
- </ul>
+ <li>
+ <select id="themes" class="nav-menu-magin-left" onchange="setTheme()">
+ <option value="black-theme">Black</option>
+ <option value="dark-theme">Dark</option>
+ <option value="light-theme">Light</option>
+ </select>
+ </li>
+ </ol>
</nav>
</header>