diff --git a/build/build.mjs b/build/build.mjs index 90045013bf6..42ae373d3ca 100644 --- a/build/build.mjs +++ b/build/build.mjs @@ -24,7 +24,9 @@ const contributorsPath = path.resolve(process.cwd(), 'CONTRIBUTORS.svg'); await FS.ensureDir(path.resolve(deployDir, 'c')); await FS.copySync(faviconPath, path.resolve(deployDir, 'img', 'favicon.ico')); - await FS.copyFile(path.resolve(process.cwd(), 'template', 'js', 'copy-to-clipboard.js'), path.resolve(deployDir, 'js', 'copy-to-clipboard.js')) + await FS.copyFile(path.resolve(process.cwd(), 'template', 'js', 'copy-to-clipboard.js'), path.resolve(deployDir, 'js', 'copy-to-clipboard.js')); + await FS.copyFile(path.resolve(process.cwd(), 'node_modules/@wcj/dark-mode/main.js'), path.resolve(deployDir, 'js', 'dark-mode.min.js')); + await FS.copyFile(path.resolve(process.cwd(), 'node_modules/@uiw/github-corners/lib/index.js'), path.resolve(deployDir, 'js', 'github-corners.js')); const jsData = await FS.readFileSync(rootIndexJSPath); await FS.outputFile(path.resolve(deployDir, 'js', 'index.js'), UglifyJS.minify(jsData.toString()).code) @@ -214,7 +216,7 @@ const contributorsPath = path.resolve(process.cwd(), 'CONTRIBUTORS.svg'); } function markdownToHTML(str) { - return create({ markdown: str, document: undefined }); + return create({ markdown: str, document: undefined, 'dark-mode': false }); } /** @@ -226,13 +228,12 @@ function markdownToHTML(str) { return new Promise((resolve, reject) => { try { const stylStr = FS.readFileSync(stylPath, 'utf8'); - const stylMD = FS.readFileSync(path.resolve('node_modules/markdown-to-html-cli/github.css'), 'utf8'); stylus(stylStr.toString()) .set('filename', stylPath) .set('compress', true) .render((err, css) => { if (err) throw err; - resolve(`${stylMD.replace(/\n/, '')}\n${css}`); + resolve(`${css}`); }); } catch (err) { reject(err); diff --git a/package.json b/package.json index b356b16049e..04291c4b1d0 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,13 @@ "url": "git+https://github.com/jaywcjlove/linux-command.git" }, "devDependencies": { + "@uiw/github-corners": "~1.5.11", + "@wcj/dark-mode": "~1.0.14", "archiver": "~5.3.0", "colors-cli": "~1.0.28", "ejs": "~3.1.6", "fs-extra": "~10.0.1", - "markdown-to-html-cli": "~3.2.5", + "markdown-to-html-cli": "~3.4.1", "sitemap-generator": "~8.5.1", "sqlite3": "~5.0.2", "stylus": "~0.56.0", diff --git a/template/contributors.ejs b/template/contributors.ejs index 66dca26ab5b..a799f612bba 100644 --- a/template/contributors.ejs +++ b/template/contributors.ejs @@ -4,7 +4,7 @@

Contributors

<%-describe.contributors ? describe.contributors : '' %>

- 数据来源于 GitHub Contributors,使用github-action-contributors创建。 + 数据来源于 GitHub Contributors,使用action-contributors创建。

<%- include('widget/footer',{type: "list"}); %> diff --git a/template/list.ejs b/template/list.ejs index b064b21935c..7d927bcbc38 100644 --- a/template/list.ejs +++ b/template/list.ejs @@ -1,6 +1,5 @@ <%- include('partial/header'); %> <%- include('widget/search',{type: "list"}); %> -