diff --git a/assets/css/_common/components/3rd/index.scss b/assets/css/_common/components/3rd/index.scss index c254fdb..51c75b2 100644 --- a/assets/css/_common/components/3rd/index.scss +++ b/assets/css/_common/components/3rd/index.scss @@ -6,7 +6,6 @@ @import 'gitter'; @import 'livere'; @import 'waline'; -@import 'mermaid'; .use-motion .animated { // Fix issue #48 #55 diff --git a/assets/css/_common/components/3rd/mermaid.scss b/assets/css/_common/components/3rd/mermaid.scss deleted file mode 100644 index 7512808..0000000 --- a/assets/css/_common/components/3rd/mermaid.scss +++ /dev/null @@ -1,3 +0,0 @@ -.post-block .post-body .mermaid { - background: var(--highlight-foreground); -} \ No newline at end of file diff --git a/assets/css/_common/scaffolding/tags/index.scss b/assets/css/_common/scaffolding/tags/index.scss index 388cb76..ee65e08 100644 --- a/assets/css/_common/scaffolding/tags/index.scss +++ b/assets/css/_common/scaffolding/tags/index.scss @@ -2,7 +2,6 @@ @import 'group-pictures'; @import 'label'; @import 'link-grid'; -@import 'mermaid'; @import 'note'; @import 'pdf'; @import 'tabs'; diff --git a/assets/css/_common/scaffolding/tags/mermaid.scss b/assets/css/_common/scaffolding/tags/mermaid.scss deleted file mode 100644 index ab8b522..0000000 --- a/assets/css/_common/scaffolding/tags/mermaid.scss +++ /dev/null @@ -1,6 +0,0 @@ -@if $mermaid_enable { - .mermaid { - margin-bottom: 20px; - text-align: center; - } -} diff --git a/assets/css/main.scss b/assets/css/main.scss index cd47ba3..1d8542f 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -7,7 +7,6 @@ $darkmode : {{ $P.darkmode }}; $body_scrollbar_overlay : {{ $P.bodyScrollbar.overlay }}; $body_scrollbar_stable : {{ $P.bodyScrollbar.stable }}; -$mermaid_enable : {{ $P.mermaid.enable }}; $mobile_layout_economy : {{ $P.mobileLayoutEconomy }}; $theme_color_dark : {{ $P.themeColor.dark }}; $theme_color_light : {{ $P.themeColor.light }}; diff --git a/assets/js/3rd/others/clipboard.js b/assets/js/3rd/others/clipboard.js index e1a6f73..e23ce38 100644 --- a/assets/js/3rd/others/clipboard.js +++ b/assets/js/3rd/others/clipboard.js @@ -1,41 +1,41 @@ /* clipboard plugin */ NexT.plugins.others.clipboard = function () { - if (!NexT.CONFIG.copybtn) return; + + let chromaDiv = document.querySelectorAll('div.highlight div.chroma'); + if (chromaDiv.length === 0) return; + + chromaDiv.forEach(element => { + // Add copy button DOM. + let codeblock = element.querySelector('code[class]:not([class=""]'); + let lang = codeblock.className; + let copyBtn = document.createElement('div'); + copyBtn.classList.add('copy-btn'); + codeblock.parentNode.appendChild(copyBtn); + + element.addEventListener('mouseleave', () => { + setTimeout(() => { + copyBtn.classList.remove('copied','uncopied'); + }, 300); + }); + + // Add code header show + var ch = document.createElement('div'); + ch.classList.add('code-header'); + ch.classList.add(lang); + ch.insertAdjacentHTML('afterbegin', + ''); + ch.addEventListener('click', function () { + element.classList.toggle('hidden-code'); + ch.querySelector('.collapse-btn').classList.toggle('collapse'); + }, false); + + element.parentNode.insertBefore(ch, element); + }); + + if (!NexT.CONFIG.copybtn || !NexT.CONFIG.page.clipboard) return; const clipboard_js = NexT.utils.getCDNResource(NexT.CONFIG.page.clipboard.js); - NexT.utils.getScript(clipboard_js, function () { - - let chromaDiv = document.querySelectorAll('div.highlight div.chroma'); - if (chromaDiv.length === 0) return; - - chromaDiv.forEach(element => { - // Add copy button DOM. - let codeblock = element.querySelector('code[class]:not([class=""]'); - let lang = codeblock.className; - let copyBtn = document.createElement('div'); - copyBtn.classList.add('copy-btn'); - codeblock.parentNode.appendChild(copyBtn); - - element.addEventListener('mouseleave', () => { - setTimeout(() => { - copyBtn.classList.remove('copied','uncopied'); - }, 300); - }); - - // Add code header show - var ch = document.createElement('div'); - ch.classList.add('code-header'); - ch.classList.add(lang); - ch.insertAdjacentHTML('afterbegin', - ''); - ch.addEventListener('click', function () { - element.classList.toggle('hidden-code'); - ch.querySelector('.collapse-btn').classList.toggle('collapse'); - }, false); - - element.parentNode.insertBefore(ch, element); - }); - + NexT.utils.getScript(clipboard_js, function () { // Register the clipboard event. var clipboard = new ClipboardJS('.copy-btn', { text: function (trigger) { diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 63af6c9..b6ce3ab 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -40,7 +40,7 @@ languageCode: zh-CN # languageCode: fr-FR # languageDirection: ltr # languageName: French -# weight: 2 +# weight: 3 # 是否包含中文,日语,韩文 # Whether contains Chinese, Japanese and Korean hasCJKLanguage: true @@ -1111,15 +1111,6 @@ params: # Default height height: 500px - # Mermaid tag - mermaid: - enable: false - # Available themes: default | dark | forest | neutral - theme: - light: default - dark: dark - - # --------------------------------------------------------------- # 动画效果设置 # Animation Settings diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 4fef69c..be8c974 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -42,7 +42,7 @@ {{ partialCached "footer.html" . }} - + {{ partial "head/config.html" . }} {{ partial "scripts.html" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ce6d99e..c63085a 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -60,6 +60,5 @@ theme.active(); })(window); -{{ partial "head/config.html" . }} {{ partialCached "head/script/analytics.html" . }} diff --git a/layouts/partials/head/config.html b/layouts/partials/head/config.html index 8bf3a27..5e1fe68 100644 --- a/layouts/partials/head/config.html +++ b/layouts/partials/head/config.html @@ -83,15 +83,4 @@ {{ $pageCfg = merge $pageCfg (dict "math" $math) }} {{ end }} - - -{{/** Special CSS Style for page **/}} -{{ if .IsPage }} - -{{ end }} \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/head/style/global.html b/layouts/partials/head/style/global.html deleted file mode 100644 index 5d3ff7b..0000000 --- a/layouts/partials/head/style/global.html +++ /dev/null @@ -1,3 +0,0 @@ -.post-footer, .flinks-list-footer hr:after { - content: "{{ .Site.Params.postFooter.endLineTip }}"; -} \ No newline at end of file diff --git a/layouts/partials/head/style/plugins.html b/layouts/partials/head/style/plugins.html deleted file mode 100644 index bcf7286..0000000 --- a/layouts/partials/head/style/plugins.html +++ /dev/null @@ -1,13 +0,0 @@ -{{/* Defind loading plugin entend style which only need in pages */}} -{{ if .IsPage }} - -{{/** Short code params **/}} -{{ $scParam := .Store.Get "scParams" }} - -{{ if $scParam.mermaid }} -.post-block .post-body .mermaid { - background: var(--highlight-foreground); -} -{{ end }} - -{{ end }} \ No newline at end of file diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html index 6ac92d9..0342de7 100644 --- a/layouts/partials/head/styles.html +++ b/layouts/partials/head/styles.html @@ -20,8 +20,22 @@ diff --git a/static/imgs/img-lazy-loading.gif b/static/imgs/img-lazy-loading.gif index 407c65d..33daf2d 100644 Binary files a/static/imgs/img-lazy-loading.gif and b/static/imgs/img-lazy-loading.gif differ