mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
docs(clipboard): refactored to intuitive key
This commit is contained in:
parent
51786f92c6
commit
873ae925ce
@ -28,6 +28,9 @@ enableLinkPreview: true
|
||||
# whether to render titles for code blocks
|
||||
enableCodeBlockTitle: true
|
||||
|
||||
# whether to render copy buttons for code blocks
|
||||
enableCodeBlockCopy: true
|
||||
|
||||
# whether to try to process Latex
|
||||
enableLatex: true
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
<script src="{{$codeTitle.Permalink}}"></script>
|
||||
{{end}}
|
||||
|
||||
{{ if $.Site.Data.config.enableClipboard }}
|
||||
{{ if $.Site.Data.config.enableCodeBlockCopy }}
|
||||
{{ $clipboard := resources.Get "js/clipboard.js" | resources.Fingerprint "md5" | resources.Minify }}
|
||||
{{ if (findRE "<pre" .Content 1) }}
|
||||
<script src="{{$clipboard.Permalink}}"></script>
|
||||
@ -92,7 +92,7 @@
|
||||
const pathWindow = window.location.pathname;
|
||||
const isHome = pathBase == pathWindow;
|
||||
|
||||
{{if $.Site.Data.config.enableClipboard -}}
|
||||
{{if $.Site.Data.config.enableCodeBlockCopy -}}
|
||||
addCopyButtons();
|
||||
{{ end }}
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
|
||||
const init = (doc = document) => {
|
||||
// NOTE: everything within this callback will be executed for initial page navigation. This is a good place to put JavaScript that only replaces DOM nodes.
|
||||
{{if $.Site.Data.config.enableClipboard -}}
|
||||
{{if $.Site.Data.config.enableCodeBlockCopy -}}
|
||||
{{if $.Site.Data.config.enableSPA -}}
|
||||
addCopyButtons();
|
||||
{{ else }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user