Skip to content

Commit

Permalink
feat: support dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Apr 23, 2021
1 parent cb2348d commit 688d3ab
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

书籍是人们获取知识的主要途径。然而,如今的社会太浮躁,不少人不愿意花时间静下心来仔细读书,很多开发人员也是如此。殊不知,书籍沉淀了前人的经验和思考。

写书不易,创作好的作品更是需要耗费很大心力,Doocs 鼓励各位同学**购买正版书籍以支持原书作者**,只要在书籍名称上点击即可跳转到购买页。好书推荐请到 [Issues 讨论区](https://github.com/doocs/technical-books/issues/2),也可以直接提交 [PR](https://github.com/doocs/technical-books/pulls)
写书不易,创作好的作品更是需要耗费很大心力,Doocs 鼓励各位同学**购买正版书籍以支持原书作者**,只要在书籍名称上点击即可跳转到购买页。好书推荐请到 [Discussions 讨论区](https://github.com/doocs/technical-books/discussions/30),也可以直接提交 [PR](https://github.com/doocs/technical-books/pulls)

- Netlify: https://techbooks.netlify.app
- Gitee Pages: https://doocs.gitee.io/technical-books
Expand Down
30 changes: 26 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.css" />
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png" />
<style>
.markdown-section code {
font-weight: 400;
}
</style>
</head>

<body>
Expand All @@ -24,6 +30,21 @@
repo: "doocs/technical-books",
auto2top: true,
search: ["/"],
darklightTheme: {
defaultTheme: 'light',
siteFont: 'Source Sans Pro,Helvetica Neue,Arial,sans-serif',
codeFontFamily: 'Roboto Mono, Monaco, courier, monospace',
bodyFontSize: '15px',
dark: {
background: '#191919',
highlightColor: '#e96900',
codeBackgroundColor: '#202020',
codeTextColor: '#b4b4b4',
},
light: {
highlightColor: '#e96900',
}
},
plugins: [
function (hook) {
const footer = [
Expand All @@ -47,12 +68,13 @@
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-json.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-java.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-python.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/gitalk.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
<script>
const gitalk = new Gitalk({
clientID: "da1e9e0847f0d713937e",
Expand Down

0 comments on commit 688d3ab

Please sign in to comment.