diff --git a/assets/js/modules/theme.js b/assets/js/modules/theme.js index 49e4e89..61a9efa 100644 --- a/assets/js/modules/theme.js +++ b/assets/js/modules/theme.js @@ -136,3 +136,5 @@ class Theme { Theme.init(); export default Theme; + +window.Theme = Theme; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 7454096..b0ed9b0 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,7 +9,7 @@ {{ $style := $sass | toCSS $opts | minify | fingerprint }} - + {{ partial "head.html" . }} {{ partial "sidebar.html" . }} diff --git a/layouts/_default/post.html b/layouts/_default/post.html index 0fae42b..ea8d4d6 100644 --- a/layouts/_default/post.html +++ b/layouts/_default/post.html @@ -1,5 +1,5 @@ {{ define "main" }} - {{ $enable_toc := and (.Params.toc | default .Site.Params.enableTOC) (gt (len .TableOfContents) 100) }} + {{ $enable_toc := and (.Params.toc | default site.Params.toc) (gt (len .TableOfContents) 100) }} {{ $lang := .Site.Language.Lang }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index b509d08..ca7d04b 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -80,7 +80,7 @@ - {{ if and site.Params.toc .Params.toc }} + {{ if .Params.toc | default site.Params.toc }} {{ end }} diff --git a/layouts/partials/js-selector.html b/layouts/partials/js-selector.html index a044168..847de4f 100644 --- a/layouts/partials/js-selector.html +++ b/layouts/partials/js-selector.html @@ -16,7 +16,7 @@ -{{ if or (eq .Type "post") (eq .Type "page") $is_home }} +{{ if or (eq .Layout "post") (eq .Layout "page") $is_home }} {{ with $data.lazyPolyfill.js }} {{ $urls = $urls | append . }} {{ end }} @@ -32,7 +32,7 @@ {{ end }} {{ end }} -{{ if or $is_home (eq .Type "post") (eq .Type "archives") (eq .Type "category") (eq .Type "tag") }} +{{ if or $is_home (eq .Layout "post") (eq .Layout "archives") (eq .Layout "category") (eq .Layout "tag") }} {{ $locale := strings.TrimSuffix (path.Ext .Lang) .Lang }} {{ with $data.dayjs.js.common }} @@ -70,13 +70,13 @@ {{ $js := "commons" }} {{ if $is_home }} {{ $js = "home" }} -{{ else if eq .Type "categories" }} +{{ else if eq .Layout "categories" }} {{ $js = "categories" }} -{{ else if eq .Type "post" }} +{{ else if eq .Layout "post" }} {{ $js = "post" }} -{{ else if eq .Type "page" }} +{{ else if eq .Layout "page" }} {{ $js = "page" }} -{{ else if or (eq .Type "archives") (eq .Type "category") (eq .Type "tag") }} +{{ else if or (eq .Layout "archives") (eq .Layout "category") (eq .Layout "tag") }} {{ $js = "misc" }} {{ end }} @@ -93,7 +93,7 @@ {{ end }} -{{ if eq .Type "post" }} +{{ if eq .Layout "post" }} {{ $provider := site.Params.pageviews.provider }} {{ if and $provider (ne $provider "") }} {{ if eq $provider "goatcounter" }}