🐛 Fxied #139, make render code block & clipboard remove last enter line.
This commit is contained in:
4
layouts/_default/_markup/render-codeblock.html
Normal file
4
layouts/_default/_markup/render-codeblock.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{{ $result := transform.HighlightCodeBlock . }}
|
||||
{{ $result.Wrapped }}
|
||||
|
||||
{{ .Page.Store.Set "codeblock" true }}
|
||||
@@ -12,6 +12,14 @@
|
||||
"title" .Page.Title
|
||||
}}
|
||||
|
||||
{{/** Append clipboard plugin */}}
|
||||
{{ if .Store.Get "codeblock" }}
|
||||
{{ $clipboard := dict
|
||||
"js" $.Site.Data.resources.plugins.clipboard.js
|
||||
}}
|
||||
{{ $pageCfg = merge $pageCfg (dict "clipboard" $clipboard) }}
|
||||
{{ end }}
|
||||
|
||||
{{/** Append APlayer plugin */}}
|
||||
{{ if $scParam.music }}
|
||||
{{ $aplayer := dict
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
{{/* Defind loading plugin scripts which only need in pages */}}
|
||||
{{ if .IsPage }}
|
||||
|
||||
{{/** Append codeblack render action **/}}
|
||||
{{ if .Store.Get "codeblock" }}
|
||||
{{ partial "_funs/get_plugin.html" (dict "ctx" . "class" "others" "plugin" "clipboard.js") }}
|
||||
{{ end }}
|
||||
|
||||
{{/** Short code params **/}}
|
||||
{{ $scParam := .Store.Get "scParams" }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user