From 1adda175206fb128dd1dfe4935215be5bfa93b0b Mon Sep 17 00:00:00 2001 From: AmazingRise <8315221+AmazingRise@users.noreply.github.com> Date: Fri, 26 Aug 2022 12:43:00 +0800 Subject: Fixed #134 and remove loadCSS. --- layouts/_default/baseof.html | 11 ++++++++++- layouts/partials/head.html | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 757b685..5cbe2a2 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -19,6 +19,15 @@ {{ partial "journal.html" .}} - + + {{- $hugoVersion := split (replaceRE ".*([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "$1 $2 $3" hugo.Version) " " -}} + {{- if and (eq (int (index $hugoVersion 0)) 0) (ge (int (index $hugoVersion 1)) 101) -}} + {{- /* no leading slash */ -}} + + {{- else -}} + {{- /* with leading slash */ -}} + + {{- end -}} + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9a08420..29a50ec 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -31,7 +31,7 @@ {{ template "_internal/google_analytics.html" . }} {{ end }} - + {{if .Site.Params.manifest}} @@ -54,10 +54,25 @@ {{ end }} - - + + +{{- $hugoVersion := split (replaceRE ".*([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "$1 $2 $3" hugo.Version) " " -}} +{{- if and (eq (int (index $hugoVersion 0)) 0) (ge (int (index $hugoVersion 1)) 101) -}} + {{- /* no leading slash */ -}} + {{ if and (not (.Params.disableToC) ) (.IsPage) }} + + {{ end }} + +{{- else -}} + {{- /* with leading slash */ -}} + {{ if and (not (.Params.disableToC) ) (.IsPage) }} + + {{ end }} + +{{- end -}} + + {{ if .Site.Params.cloudflareToken }} @@ -90,14 +105,20 @@ {{ end }} -{{ if and (not (.Params.disableToC) ) (.IsPage) }} - -{{ end }} + {{ if and ( and ( .Site.Params.enableGitalk ) ( .IsPage ) ) ( or ( not ( isset .Params "comment" ) ) ( eq .Params.comment true ) ) }} - + +{{- $hugoVersion := split (replaceRE ".*([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "$1 $2 $3" hugo.Version) " " -}} +{{- if and (eq (int (index $hugoVersion 0)) 0) (ge (int (index $hugoVersion 1)) 101) -}} + {{- /* no leading slash */ -}} + +{{- else -}} + {{- /* with leading slash */ -}} + +{{- end -}}