From d33691eed6c1e5f1f7bf710b77ff3a01a65cea3c Mon Sep 17 00:00:00 2001 From: June Date: Mon, 28 Nov 2022 11:11:24 +0800 Subject: Support for more social icons --- layouts/_default/baseof.html | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'layouts/_default/baseof.html') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 49a4c23..59edd63 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,32 +7,30 @@ {{ $title := .Title }} - {{ if not .IsHome }} + {{- if not .IsHome }} {{ $title = printf "%s | %s" .Title .Site.Title }} - {{ end }} + {{ end -}} {{ $title }} - {{ with .Site.Params.author }} + {{- with .Site.Params.author }} - {{ end }} + {{ end -}} {{ template "_internal/twitter_cards.html" . }} {{ template "_internal/opengraph.html" . }} - - - + + {{ $options := (dict "outputStyle" "compressed" "enableSourceMap" (not hugo.IsProduction) "includePaths" (slice "sass")) }} - {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} + {{- $style := resources.Get "sass/main.scss" | resources.ToCSS $options -}} - {{ $zoom_css := resources.Get "zoomjs/zoom.css" | resources.Minify }} + {{ $zoom_css := resources.Get "zoomjs/zoom.css" | resources.Minify -}} {{ range .Site.Params.custom_css -}} @@ -41,18 +39,18 @@ {{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }} {{ end }} - {{ end }} + {{- end -}} - {{ range .Site.Params.custom_js -}} + {{- range .Site.Params.custom_js -}} {{ $custom_template := resources.Get . }} {{ if $custom_template }} {{ $custom_js := $custom_template | resources.Minify | resources.Fingerprint }} {{ end }} - {{ end }} + {{ end -}} {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} @@ -75,20 +73,19 @@ - - {{ $header_img := .Param "header_img" }} - {{ if .IsHome }} + {{- $header_img := .Param "header_img" -}} + {{- if .IsHome -}} {{ $header_img = .Site.Params.img_home }} - {{ else if eq .Kind "404" }} + {{- else if eq .Kind "404" -}} {{ $header_img = .Site.Params.img_404 }} - {{ end }} - {{ if $header_img }} + {{- end -}} + {{- if $header_img -}} {{ .Scratch.Set "header_img" ( $header_img | relURL ) }} - {{ end }} + {{- end -}} - {{ if and .IsPage (.Params.toc) }} + {{- if and .IsPage (.Params.toc) }} {{ .Scratch.Set "toc" true }} - {{ end }} + {{ end -}} {{ partial "nav.html" . }} -- cgit v1.2.3