Skip to content

Commit

Permalink
code 调整
Browse files Browse the repository at this point in the history
  • Loading branch information
tangly1024 committed Jul 26, 2023
1 parent 5cf74fc commit 155d5ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const BLOG = {
PRISM_THEME_DARK_PATH: 'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism-okaidia.min.css', // 深色模式主题

CODE_MAC_BAR: process.env.NEXT_PUBLIC_CODE_MAC_BAR || true, // 代码左上角显示mac的红黄绿图标
CODE_LINE_NUMBERS: process.env.NEXT_PUBLIC_CODE_LINE_NUMBERS || 'false', // 是否显示行号
CODE_LINE_NUMBERS: process.env.NEXT_PUBLIC_CODE_LINE_NUMBERS || false, // 是否显示行号
CODE_COLLAPSE: process.env.NEXT_PUBLIC_CODE_COLLAPSE || true, // 是否折叠代码框
// END********代码相关********

Expand Down
4 changes: 2 additions & 2 deletions components/PrismMac.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function renderPrismMac() {
const container = document?.getElementById('notion-article')

// Add line numbers
if (BLOG.CODE_LINE_NUMBERS === 'true') {
if (JSON.parse(BLOG.CODE_LINE_NUMBERS)) {
const codeBlocks = container?.getElementsByTagName('pre')
if (codeBlocks) {
Array.from(codeBlocks).forEach(item => {
Expand Down Expand Up @@ -192,7 +192,7 @@ function renderPrismMac() {
}

// 折叠代码行号bug
if (BLOG.CODE_LINE_NUMBERS === 'true') {
if (JSON.parse(BLOG.CODE_LINE_NUMBERS)) {
fixCodeLineStyle()
}
}
Expand Down

0 comments on commit 155d5ea

Please sign in to comment.