Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(menu): hide divider when no menus (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveA-W authored May 4, 2020
1 parent 4190c79 commit 417851b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
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

0 comments on commit 417851b

Please sign in to comment.