@ -41,11 +41,8 @@
< ol class = "social-menu" >
< ol class = "social-menu" >
{{ range . }}
{{ range . }}
< li >
< li >
< a
< a href = '{{ .URL }}' { { if eq ( default true . Params . newTab ) true } } target = "_blank" { { end } } { { with . Name
href='{{ .URL }}'
}}title="{{ . }}" {{ end }}>
{{ if eq (default true .Params.newTab) true }}target="_blank"{{ end }}
{{ with .Name }}title="{{ . }}"{{ end }}
>
{{ $icon := default "link" .Params.Icon }}
{{ $icon := default "link" .Params.Icon }}
{{ with $icon }}
{{ with $icon }}
{{ partial "helper/icon" . }}
{{ partial "helper/icon" . }}
@ -59,13 +56,15 @@
< ol class = "menu" id = "main-menu" >
< ol class = "menu" id = "main-menu" >
{{ $currentPage := . }}
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ range .Site.Menus.main }}
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .)
($currentPage.IsMenuCurrent "main" .)) }}
< li { { if $ active } } class = 'current' { { end } } >
< li { { if $ active } } class = 'current' { { end } } >
< a href = '{{ .URL | relLangURL }}' { { if eq . Params . newTab true } } target = "_blank" { { end } } >
< a href = '{{ .URL | relLangURL }}' { { if eq . Params . newTab true } } target = "_blank" { { end } } >
{{ $icon := default .Pre .Params.Icon }}
{{ $icon := default .Pre .Params.Icon }}
{{ if .Pre }}
{{ if .Pre }}
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
{{ errorf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore
information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
{{ end }}
{{ end }}
{{ with $icon }}
{{ with $icon }}
{{ partial "helper/icon" . }}
{{ partial "helper/icon" . }}
@ -82,7 +81,8 @@
{{ partial "helper/icon" "language" }}
{{ partial "helper/icon" "language" }}
< select name = "language" onchange = "window.location.href = this.selectedOptions[0].value" >
< select name = "language" onchange = "window.location.href = this.selectedOptions[0].value" >
{{ range . }}
{{ range . }}
< option value = "{{ .Permalink }}" { { if eq . Language . Lang $ currentLanguageCode } } selected { { end } } > {{ .Language.LanguageName }}< / option >
< option value = "{{ .Permalink }}" { { if eq . Language . Lang $ currentLanguageCode } } selected { { end } } > {{
.Language.LanguageName }}< / option >
{{ end }}
{{ end }}
< / select >
< / select >
< / li >
< / li >