Skip to content

Commit

Permalink
style: footer menu
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 29, 2023
1 parent f230f2d commit b601eb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions assets/main/scss/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
.social-link {
font-size: 1.5em;
}

.nav-link {
text-overflow: ellipsis;
}
}
16 changes: 10 additions & 6 deletions layouts/partials/footer/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<li class="nav-item col-12 col-md-6 col-lg-3 px-0">
{{- if .HasChildren -}}
<ul class="nav flex-column align-items-start">
<li class="nav-item">
<li class="nav-item w-100">
{{- template "footer-menu-item" (dict "item" . "class" "nav-link fw-bold fs-lg") -}}
</li>
{{- range .Children -}}
{{- if .Params.divider -}}
<li><hr class="dropdown-divider"></li>
{{- else -}}
<li class="nav-item">
<li class="nav-item w-100">
{{- template "footer-menu-item" (dict "item" .) -}}
</li>
{{- end -}}
{{- end -}}
</ul>
{{- else -}}
<li class="nav-item">
<li class="nav-item w-100">
{{- template "footer-menu-item" (dict "item" .) -}}
</li>
{{- end -}}
Expand All @@ -29,10 +29,14 @@
{{- end -}}

{{- define "footer-menu-item" -}}
{{- $class := default "nav-link" .class -}}
{{- $class := default "nav-link text-nowrap overflow-hidden" .class -}}
{{- $title := partial "helpers/menu-name" .item }}
{{- if .item.URL -}}
<a class="{{ $class }}" href="{{ .item.URL }}"{{ if not .item.Page }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ partial "helpers/menu-name" .item }}</a>
<a class="{{ $class }}" title="{{ $title }}"
href="{{ .item.URL }}"{{ if not .item.Page }} target="_blank" rel="noopener noreferrer"{{ end }}>
{{- $title -}}
</a>
{{- else -}}
<a class="{{ $class }}" href="javascript: void(0);">{{ partial "helpers/menu-name" .item }}</a>
<a class="{{ $class }}" href="javascript: void(0);">{{ $title }}</a>
{{- end -}}
{{- end -}}

0 comments on commit b601eb9

Please sign in to comment.