summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-09-02 20:22:08 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2021-09-02 20:22:08 +0530
commit7ea01a0ab23ec303c28907740a19c672fc261c4b (patch)
treebd636af11bf5a9b1c4fb0b8473a1f7d93f4990ff
parent3442d5cb528c83c07123257503259ea654bed6e1 (diff)
Allow hiding `ShowCodeCopyButtons` per page
closes: #548
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/partials/footer.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 37c595b..6dfe741 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -17,7 +17,7 @@
<main class="main">
{{- block "main" . }}{{ end }}
</main>
- {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") -}}
+ {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}}
</body>
</html>
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 3cebf48..4f7182b 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -84,7 +84,7 @@
</script>
{{- end }}
-{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Site.Params.ShowCodeCopyButtons)) }}
+{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }}
<script>
document.querySelectorAll('pre > code').forEach((codeblock) => {
const container = codeblock.parentNode.parentNode;