diff options
-rw-r--r-- | _config.yml | 7 | ||||
-rw-r--r-- | assets/css/style.scss | 15 | ||||
-rw-r--r-- | assets/js/main.js | 43 |
3 files changed, 22 insertions, 43 deletions
diff --git a/_config.yml b/_config.yml index 87494a1..7cab47c 100644 --- a/_config.yml +++ b/_config.yml @@ -7,13 +7,6 @@ description: Mayx's Home Page timezone: Asia/Shanghai excerpt_separator: <!--more--> paginate: 7 -kramdown: - syntax_highlighter_opts: - span: - line_numbers: false - block: - line_numbers: true - start_line: 1 plugins: - jekyll-sitemap - jekyll-feed diff --git a/assets/css/style.scss b/assets/css/style.scss index 5d7a616..b59d669 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -99,19 +99,4 @@ div.highlight button:active, div.highlight button:focus, div.highlight button:hover { opacity: 1 -} - -table.rouge-table { - margin: 0; -} - -td.rouge-gutter, -td.rouge-code { - padding: 0; - border-bottom: none; -} - -pre.lineno { - padding: 0 10px 0 0; - border: none; } \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js index 72fe6f0..805318d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -76,31 +76,32 @@ $(function () { highlightTextNodes(this); }); }); +$(function () { + var codeBlocks = document.querySelectorAll('div.highlight'); -var codeBlocks = document.querySelectorAll('div.highlight'); - -codeBlocks.forEach(function (codeBlock) { - var copyButton = document.createElement('button'); - copyButton.className = 'copy'; - copyButton.type = 'button'; - copyButton.innerText = '📋'; + codeBlocks.forEach(function (codeBlock) { + var copyButton = document.createElement('button'); + copyButton.className = 'copy'; + copyButton.type = 'button'; + copyButton.innerText = '📋'; - codeBlock.append(copyButton); + codeBlock.append(copyButton); - copyButton.addEventListener('click', function () { - var code = codeBlock.querySelector('.rouge-code pre').innerText.trim(); - window.navigator.clipboard.writeText(code) - .then(() => { - copyButton.innerText = '✅'; - }) - .catch(err => { - copyButton.innerText = '❌'; - console.error('Failed to copy:', err); - }); + copyButton.addEventListener('click', function () { + var code = codeBlock.querySelector('pre code').innerText.trim(); + window.navigator.clipboard.writeText(code) + .then(() => { + copyButton.innerText = '✅'; + }) + .catch(err => { + copyButton.innerText = '❌'; + console.error('Failed to copy:', err); + }); - setTimeout(function () { - copyButton.innerText = '📋'; - }, 1500); + setTimeout(function () { + copyButton.innerText = '📋'; + }, 1500); + }); }); }); |