From e44658b9b6893c4cc02bb6048faeceb8602d9763 Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Sun, 9 Oct 2022 03:45:35 +0200 Subject: [PATCH] fix copy code param --- layouts/partials/script.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/script.html b/layouts/partials/script.html index 18bed449..bc29fbda 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -16,7 +16,7 @@ {{- /* PaperMod.js */}} {{- $scrollToTop := (not site.Params.disableScrollToTop | default .Params.disableScrollToTop ) }} {{- $themeToggle := (not site.Params.disableThemeToggle | default .Params.disableThemeToggle ) }} -{{- $showCodeCopyButtons := ((and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (site.Params.ShowCodeCopyButtons)) | default .Params.ShowCodeCopyButtons ) }} +{{- $showCodeCopyButtons := ((and (.IsPage) (ne .Layout "archives") (ne .Layout "search") (site.Params.ShowCodeCopyButtons)) | default .Params.ShowCodeCopyButtons ) }} {{- $papermod := resources.Get "js/papermod.js" | js.Build (dict "params" (dict "scrollToTop" $scrollToTop "themeToggle" $themeToggle "showCodeCopyButtons" $showCodeCopyButtons)) | resources.Minify }} {{- if not site.Params.assets.disableFingerprinting }} {{- $papermod_js := (slice $papermod) | resources.Concat "assets/js/papermod.js" | fingerprint }}