-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
layouts: split footer partial in several partials
This allows to more easily override some parts of the footer. Signed-off-by: Yann Soubeyrand <[email protected]>
- Loading branch information
1 parent
e3d83dc
commit 9e33776
Showing
5 changed files
with
34 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,15 @@ | ||
{{ $links := .Site.Params.links -}} | ||
<footer class="td-footer row d-print-none"> | ||
<div class="container-fluid"> | ||
<div class="row mx-md-2"> | ||
<div class="col-6 col-sm-4 text-xs-center order-sm-2"> | ||
{{ with $links }} | ||
{{ with index . "user" }} | ||
{{ template "footer-links-block" . }} | ||
{{ end }} | ||
{{ end }} | ||
<div class="col-6 col-sm-4 text-xs-center order-sm-1"> | ||
{{ partial "footer/left.html" . }} | ||
</div> | ||
<div class="col-6 col-sm-4 text-end text-xs-center order-sm-3"> | ||
{{ with $links }} | ||
{{ with index . "developer" }} | ||
{{ template "footer-links-block" . }} | ||
{{ end }} | ||
{{ end }} | ||
{{ partial "footer/right.html" . }} | ||
</div> | ||
<div class="td-footer__copyright-etc col-12 col-sm-4 text-center py-2 order-sm-2"> | ||
{{ with .Site.Params.copyright -}} | ||
<span>© {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }}</span> | ||
{{- end }} | ||
{{ with .Site.Params.privacy_policy -}} | ||
<span class="ms-1"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span> | ||
{{- end }} | ||
{{ if not .Site.Params.ui.footer_about_disable -}} | ||
{{ with .Site.GetPage "about" -}} | ||
<p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p> | ||
{{- end -}} | ||
{{ end }} | ||
{{ partial "footer/center.html" . }} | ||
</div> | ||
</div> | ||
</div> | ||
</footer> | ||
|
||
{{- define "footer-links-block" }} | ||
<ul class="td-footer__links-list"> | ||
{{ range . }} | ||
<li class="td-footer__links-item" data-bs-toggle="tooltip" title="{{ .name }}" aria-label="{{ .name }}"> | ||
<a target="_blank" rel="noopener" href="{{ .url }}" aria-label="{{ .name }}"> | ||
<i class="{{ .icon }}"></i> | ||
</a> | ||
</li> | ||
{{ end }} | ||
</ul> | ||
{{ end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{ with .Site.Params.copyright -}} | ||
<span>© {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }}</span> | ||
{{- end }} | ||
{{ with .Site.Params.privacy_policy -}} | ||
<span class="ms-1"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span> | ||
{{- end }} | ||
{{ if not .Site.Params.ui.footer_about_disable -}} | ||
{{ with .Site.GetPage "about" -}} | ||
<p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p> | ||
{{- end -}} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ with .Site.Params.links }} | ||
{{ with index . "user" }} | ||
{{ partial "footer/links.html" . }} | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<ul class="td-footer__links-list"> | ||
{{ range . }} | ||
<li class="td-footer__links-item" data-bs-toggle="tooltip" title="{{ .name }}" aria-label="{{ .name }}"> | ||
<a target="_blank" rel="noopener" href="{{ .url }}" aria-label="{{ .name }}"> | ||
<i class="{{ .icon }}"></i> | ||
</a> | ||
</li> | ||
{{ end }} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ with .Site.Params.links }} | ||
{{ with index . "developer" }} | ||
{{ partial "footer/links.html" . }} | ||
{{ end }} | ||
{{ end }} |