summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-07-17 21:02:06 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-07-17 21:02:06 +0200
commit9b26aecc75ca2ee2b4298d1e49a8876552fee633 (patch)
tree412be4431bfd4c0c163883988c2bda14abf814d8 /layouts
parent304cf8b6b2b6769200d6964e6869cbed086fd52f (diff)
downloadgohugo-theme-ed-9b26aecc75ca2ee2b4298d1e49a8876552fee633.tar.gz
Correct code formatting, minor html fix for footer
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/footer.html31
-rw-r--r--layouts/partials/sidebar.html20
2 files changed, 25 insertions, 26 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 654a7a8..8fde6f6 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,21 +1,20 @@
-{{ if or site.Params.footer .Params.editor }}
+{{- if or site.Params.footer .Params.editor }}
<div class="sidebar-item">
<p>
- {{ with site.Params.footer }}
- {{ $footerText := replace . "{year}" now.Year }}
- {{ $footerText | safeHTML }}
- {{ end }}
- {{ with .Params.editor }}
- <p>
- {{ i18n "edited_by" . }},
- {{ if not $.Params.Lastmod.IsZero }}
- {{ $.Params.Lastmod.Format "2006" }}
- {{ else }}
- {{ now.Format "2006" }}
- {{ end }}
- .
- </p>
- {{ end }}
+ {{- with site.Params.footer -}}
+ {{- $footerText := replace . "{year}" now.Year -}}
+ {{- $footerText | safeHTML -}}
+ {{- end -}}
</p>
+ {{- with .Params.editor }}
+ <p>
+ {{ i18n "edited_by" . }},&nbsp;
+ {{- if not $.Params.Lastmod.IsZero -}}
+ {{- $.Params.Lastmod.Format "2006" -}}
+ {{- else -}}
+ {{- now.Format "2006" -}}
+ {{- end }}.
+ </p>
+ {{- end }}
</div>
{{ end }}
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 41652db..713d81d 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -9,27 +9,27 @@
</div>
<nav class="sidebar-nav">
- {{ $current := . }}
- {{ range site.Menus.main }}
- {{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }}
- {{ $active = or $active (eq .URL $current.RelPermalink) }}
- {{ $active = or $active (eq .Name $current.Title) }}
+ {{- $current := . -}}
+ {{- range site.Menus.main -}}
+ {{- $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) -}}
+ {{- $active = or $active (eq .URL $current.RelPermalink) -}}
+ {{- $active = or $active (eq .Name $current.Title) }}
<a class="sidebar-nav-item{{ if $active }} active{{ end }}"
href="{{ .URL }}"
id="menu-main-{{ .Identifier }}"
{{- if eq .Params.external true }} target="_blank" rel="noopener noreferrer"{{ end }}>
{{- print .Name | safeHTML -}}
</a>
- {{ end }}
+ {{- end }}
- {{/* TODO: Add hypothesis support */}}
+ {{- /* TODO: Add hypothesis support */ -}}
- {{ with site.Menus.feeds }}
+ {{- with site.Menus.feeds }}
<div class="sidebar-nav-item">
- {{ range $i, $ := site.Menus.feeds }}
+ {{- range $i, $ := site.Menus.feeds }}
{{ if $i }}<span aria-hidden="true">|</span>{{ end }}
<a href="{{ .URL }}" id="menu-feeds-{{ .Identifier }}">
- {{ print .Name | safeHTML }}
+ {{- print .Name | safeHTML -}}
</a>
{{ end }}
</div>