Show Code Copy scripts only on Kind = page

This commit is contained in:
Aditya Telange 2021-04-10 11:53:23 +05:30
parent 17c4da86b5
commit 6c64ad0695
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" . -}}
{{ partialCached "footer.html" . .Layout .Kind -}}
</body>
</html>

View File

@ -85,7 +85,7 @@
</script>
{{- end }}
{{- if (not .Site.Params.disableCodeCopy) }}
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not .Site.Params.disableCodeCopy)) }}
<script>
document.querySelectorAll('pre > code').forEach((codeblock) => {
const container = codeblock.parentNode.parentNode;