mirror of
https://github.com/jbowdre/virtuallypotato.git
synced 2024-11-24 07:52:19 +00:00
minor search tweaks
This commit is contained in:
parent
9ed2c8d9c9
commit
f38cff15e4
4 changed files with 42 additions and 42 deletions
|
@ -8,7 +8,7 @@ html, body
|
||||||
img
|
img
|
||||||
max-height: 2rem
|
max-height: 2rem
|
||||||
// search box
|
// search box
|
||||||
&-item
|
&_search
|
||||||
display: grid
|
display: grid
|
||||||
align-items: center
|
align-items: center
|
||||||
.search
|
.search
|
||||||
|
|
|
@ -20,7 +20,7 @@ other = "View source"
|
||||||
other = "No matches found"
|
other = "No matches found"
|
||||||
|
|
||||||
[quick_links]
|
[quick_links]
|
||||||
other = "Quick links"
|
other = "Quick results"
|
||||||
|
|
||||||
[search_field_placeholder]
|
[search_field_placeholder]
|
||||||
other = "Search"
|
other = "Search"
|
||||||
|
|
39
layouts/partials/header.html
Normal file
39
layouts/partials/header.html
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{{- $params := .Site.Params }}
|
||||||
|
{{- $centerLogo := $params.centerLogo }}
|
||||||
|
{{ $logo := $params.logo }}
|
||||||
|
<header class="nav_header" >
|
||||||
|
<nav class="nav">
|
||||||
|
{{- if $centerLogo }}
|
||||||
|
{{- partialCached "logo" (dict "logo" $logo "class" "nav_hide") }}
|
||||||
|
{{- else }}
|
||||||
|
{{- partialCached "logo" (dict "logo" $logo) }}
|
||||||
|
{{- end }}
|
||||||
|
<div class='nav_body nav_body_{{ default "left" $params.mobileNavigation }}'>
|
||||||
|
{{ $context := . }}
|
||||||
|
{{ $menuData := .Site.Data.menu }}
|
||||||
|
{{ with $menuData }}
|
||||||
|
{{ partial "nav" (dict "context" $context "menu" $menuData) }}
|
||||||
|
{{- else }}
|
||||||
|
{{ partial "nav" (dict "context" . "menu" .Site.Menus.main) }}
|
||||||
|
{{- end }}
|
||||||
|
{{ if .Site.IsMultiLingual }}
|
||||||
|
<div class="nav_parent">
|
||||||
|
<a href="#" class="nav_item">{{ $params.languageMenuName }}</a>
|
||||||
|
<div class="nav_sub">
|
||||||
|
<span class="nav_child"></span>
|
||||||
|
{{ range .Site.Home.AllTranslations }}
|
||||||
|
<a href="{{ .Permalink }}" class="nav_child nav_item">{{ .Language.LanguageName }}</a>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end }}
|
||||||
|
{{- if $centerLogo }}
|
||||||
|
{{- partial "logo" (dict "logo" $logo "class" "nav_center") }}
|
||||||
|
{{- end }}
|
||||||
|
<li class="nav_search">
|
||||||
|
{{- partial "search" . }}
|
||||||
|
</li>
|
||||||
|
{{- partialCached "follow" . }}
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
|
@ -1,39 +0,0 @@
|
||||||
{{- $menu := .menu }}
|
|
||||||
{{ $menuData := .context.Site.Data.menu }}
|
|
||||||
{{- $link := .context.Permalink }}
|
|
||||||
{{- $url := "" }}
|
|
||||||
{{- $name := "" }}
|
|
||||||
{{- $forwardSlash := "/" }}
|
|
||||||
{{- $children := false }}
|
|
||||||
{{- range $menu }}
|
|
||||||
{{- if eq $menu $menuData }}
|
|
||||||
{{- $children = .submenu }}
|
|
||||||
{{- $name = .name }}
|
|
||||||
{{- $url = absURL .link }}
|
|
||||||
{{- else }}
|
|
||||||
{{- $children = .Children }}
|
|
||||||
{{- $name = .Name }}
|
|
||||||
{{- $url = absLangURL .URL }}
|
|
||||||
{{- end }}
|
|
||||||
<div class="nav_parent{{ if (and (not .Children) (eq (trim $url $forwardSlash) (trim $link $forwardSlash))) }} nav_active{{ end}}">
|
|
||||||
<a href="{{ $url }}" class="nav_item" title="{{ $name }}">{{ $name }} {{ with $children }}<img src='{{ absURL "icons/caret-icon.svg" }}' alt="icon" class="nav_icon">{{ end }}</a>
|
|
||||||
{{- with $children }}
|
|
||||||
<div class="nav_sub">
|
|
||||||
<span class="nav_child"></span>
|
|
||||||
{{- range . }}
|
|
||||||
{{- if eq $menu $menuData }}
|
|
||||||
{{- $name = .name }}
|
|
||||||
{{- $url = absURL .link }}
|
|
||||||
{{- else }}
|
|
||||||
{{- $name = .Name }}
|
|
||||||
{{- $url = absLangURL .URL }}
|
|
||||||
{{- end }}
|
|
||||||
<a href="{{ $url }}" class="nav_child nav_item" title="{{ $name }}">{{ $name }}</a>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
||||||
<li class="nav-item">
|
|
||||||
{{- partial "search" . }}
|
|
||||||
</li>
|
|
Loading…
Reference in a new issue