Allow hiding ShowCodeCopyButtons per page

closes: #548
This commit is contained in:
Aditya Telange 2021-09-02 20:22:08 +05:30
parent 3442d5cb52
commit 7ea01a0ab2
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 2 additions and 2 deletions

View File

@ -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>

View File

@ -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;