🚧 Change the code block style settings.
This commit is contained in:
@@ -10,7 +10,7 @@ if (!window.NexT) window.NexT = {};
|
||||
"darkmode" : {{ .Site.Params.darkmode }},
|
||||
"version" : "{{ .Site.Data.config.version }}",
|
||||
"sidebar" : {{ .Site.Params.sidebar | jsonify }},
|
||||
"copycode" : {{ .Site.Params.codeblock.copyBtn | jsonify }},
|
||||
"copybtn" : {{ .Site.Params.codeblock.copyBtn }},
|
||||
"bookmark" : {{ .Site.Params.bookmark | jsonify }},
|
||||
"comments" : {{ .Site.Params.comments | jsonify }},
|
||||
"mediumzoom" : {{ .Site.Params.mediumzoom }},
|
||||
|
||||
@@ -45,7 +45,7 @@ NexT.boot.refresh = function() {
|
||||
CONFIG.pangu && window.pangu.spacingPage();
|
||||
|
||||
CONFIG.isPage && NexT.utils.replacePostCRLink();
|
||||
CONFIG.isPage && NexT.utils.registerCopyCode();
|
||||
CONFIG.isPage && CONFIG.copybtn && NexT.utils.registerCopyCode();
|
||||
NexT.utils.registerTabsTag();
|
||||
/*NexT.utils.registerActiveMenuItem();
|
||||
NexT.utils.registerLangSelect();*/
|
||||
|
||||
@@ -41,7 +41,7 @@ NexT.utils = {
|
||||
*/
|
||||
registerCopyCode: function() {
|
||||
let figure = document.querySelectorAll('.highlight pre');
|
||||
if (figure.length === 0 || !CONFIG.copycode) return;
|
||||
if (figure.length === 0 || !CONFIG.copybtn) return;
|
||||
figure.forEach(element => {
|
||||
let cn = element.querySelector('code').className;
|
||||
// TODO seems hard code need find other ways fixed it.
|
||||
|
||||
Reference in New Issue
Block a user