Add taxonomies menu when mobile, Add missing target=_blank

#194 #193
This commit is contained in:
zzossig 2020-02-21 02:01:57 +09:00
parent 71e457e19e
commit e4edc01d17
9 changed files with 43 additions and 12 deletions

View File

@ -244,6 +244,9 @@ notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase",
# header
homeHeaderType = "text" # text, img, slide
# menu
showMobileMenuTerms = ["tags", "categories", "series"]
# navbar
enableThemeChange = true # site color theme

View File

@ -252,6 +252,9 @@ notAllowedTypesInHomeFeed = ["about", "archive", "contact", "talks", "showcase",
# header
homeHeaderType = "text" # text, img, slide
# menu
showMobileMenuTerms = ["tags", "categories", "series"]
# navbar
enableThemeChange = true # site color theme

View File

@ -477,6 +477,14 @@
@include flexbox();
&--term {
&[data-index="0"] {
@include themify($themes) {
border-top: 1px solid themed('search-border-outline-color');
}
}
}
&--item {
height: $grid-navbar-height;

View File

@ -22,10 +22,16 @@
}
&__list {
width: 50%;
@include flexbox();
@include align-items(center);
@include flex-wrap(wrap);
width: 50%;
@media only screen and (max-width: 769px) {
width: 100%;
padding: 2rem 1rem;
}
}
&__item {

View File

@ -18,6 +18,9 @@ enableUiAnimation = true
# header
homeHeaderType = "text" # text, img, slide
# menu
showMobileMenuTerms = ["tags", "categories", "series"]
# body
enableBreadcrumb = true
enablePhotoSwipe = true

View File

@ -30,7 +30,7 @@
{{ end }}
{{ if $.Param "showPoweredBy" }}
<p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zzo" rel="noreferrer">Zzo theme</a></p>
<p class="caption">Powered by <a href="https://gohugo.io/" target="_blank" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zzo" target="_blank" rel="noreferrer">Zzo theme</a></p>
{{ end }}
</div>

View File

@ -10,14 +10,22 @@
<div class="navbarm__collapse" data-open="false">
<ul>
{{ $current := . }}
{{ range .Site.Menus.main }}
{{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }}
{{ $active = or $active (eq .Name $current.Title) }}
{{ $active = or $active (eq (lower .URL) (lower $current.Title)) }}
{{ $active = or $active (eq (lower .URL) (lower $current.Type)) }}
<li class="navbarm__menu--item {{ if $active }}active{{ end }}">
<a href="{{ .URL | relLangURL }}">{{ safeHTML .Name }}</a>
</li>
{{ range $index, $menu := .Site.Menus.main }}
{{ $active := or ($current.IsMenuCurrent "main" $menu) ($current.HasMenuCurrent "main" $menu) }}
{{ $active = or $active (eq $menu.Name $current.Title) }}
{{ $active = or $active (eq (lower $menu.URL) (lower $current.Title)) }}
{{ $active = or $active (eq (lower $menu.URL) (lower $current.Type)) }}
<li class="navbarm__menu--item {{ if $active }}active{{ end }}">
<a href="{{ $menu.URL | relLangURL }}">{{ safeHTML $menu.Name }}</a>
</li>
{{ end }}
{{ range $index, $term := $.Site.Params.showMobileMenuTerms }}
<li class="navbarm__menu--item {{ if (in $current.Permalink $term) }}active{{ end }}">
<a href="{{ $term | relLangURL }}" class="navbarm__menu--term" data-index="{{ $index }}">
{{ i18n $term }}
</a>
</li>
{{ end }}
</ul>
</div>

View File

@ -69,7 +69,7 @@
<div class="bio__social">
{{ range $name, $path := $.Param "socialOptions" }}
{{ if (and $path (ne $name "email")) }}
<a href="{{ $path | safeURL }}" title="{{ $name }}" aria-label="{{ $name }}">
<a href="{{ $path | safeURL }}" target="_blank" rel="noreferrer" title="{{ $name }}" aria-label="{{ $name }}">
{{ partial (print "svgs/social/" $name ".svg") (dict "width" 25 "height" 25) }}
</a>
{{ end }}