Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(menu): hide divider when no menus #307

Merged
merged 11 commits into from
May 4, 2020
3 changes: 3 additions & 0 deletions assets/css/_page/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
@include border-radius(100%);
@include box-shadow(0 0 0 .3618em rgba(0, 0, 0, .05));
@include transition(all 0.4s ease);
}

a img {
cursor: pointer;

&:hover {
Expand Down
4 changes: 3 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
{{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}}
</a>
{{- end -}}
<span class="menu-item delimiter"></span>
{{- if .Site.Menus.main -}}
<span class="menu-item delimiter"></span>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
{{- .Language.LanguageName -}}
Expand Down
18 changes: 14 additions & 4 deletions layouts/partials/home/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
{{- with .Site.Params.home.profile.gravatarEmail -}}
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%s?s=240&d=mp" -}}
{{- end -}}
{{- with $avatar -}}
{{- if $avatar -}}
<div class="home-avatar">
<a href="/posts" title="{{ T `home` }}">
{{- dict "src" . "alt" (T "home") | partial "plugin/image.html" -}}
</a>
{{- $firstMenu := "" -}}
{{- if .Site.Menus.main -}}
{{- range first 1 $.Site.Menus.main -}}
{{- $firstMenu = . -}}
{{- end -}}
{{- end -}}
{{- with $firstMenu -}}
<a href="{{- .URL -}}" title="{{- .Name -}}">
{{- dict "src" $avatar "alt" .Name | partial "plugin/image.html" -}}
</a>
{{- else -}}
{{- dict "src" $avatar "alt" " " | partial "plugin/image.html" -}}
{{- end -}}
</div>
{{- end -}}

Expand Down