-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
288 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
<div id="intro" align="center"></div> | ||
|
||
# cnblogs-theme-silence | ||
|
||
> 一款专注于阅读的博客园主题 | ||
> 专 注 于 阅 读 的 博 客 园 主 题 | ||
## 特性 | ||
|
||
- 界面简洁优雅。 | ||
- 响应式网页设计。 | ||
- 容易使用并且轻量。 | ||
- 代码简单且可高度定制。 | ||
- 支持多种色彩主题。 | ||
- 支持日间/夜间模式。 | ||
- 支持自定义导航栏菜单项。 | ||
- 支持悬浮标题目录。 | ||
- 支持生成文章版权签名。 | ||
- 提供赞赏功能。 | ||
|
||
- 界面简洁优雅,响应式网页设计。 | ||
- 轻量配置,文档给力,非常容易使用。 | ||
- 提供暗黑模式和多种色彩主题,可随时切换。 | ||
- 支持自定义导航栏菜单项、悬浮标题目录等。 | ||
- 提供文章版权签名、赞赏功能等。 | ||
- 项目结构清晰,代码简单,可实现高度定制化开发。 | ||
|
||
## 开发 | ||
|
||
项目采用主流的前端模块化工具构建,熟悉前端开发的园友可参考下面的命令进行二次开发,定制化属于自己的独特主题风格。 | ||
该项目基于模块化工具 webpack 构建,熟悉前端开发的园友可以 fork 当前仓库,然后参考如下命令进行二次开发,定制化自己独特的主题风格。 | ||
|
||
``` | ||
git clone https://github.com/esofar/cnblogs-theme-silence.git // 克隆代码 | ||
cd cnblogs-theme-silence // 进入目录 | ||
npm install // 安装依赖 | ||
npm start // 本地调试 | ||
npm run build // 编译生成 | ||
// 克隆代码 | ||
git clone https://github.com/esofar/cnblogs-theme-silence.git | ||
// 进入目录 | ||
cd cnblogs-theme-silence | ||
// 安装依赖 | ||
npm install | ||
// 本地调试 | ||
npm start | ||
// 编译发布 | ||
npm run build | ||
``` | ||
|
||
## 贡献 | ||
|
||
若您在使用中发现 Bug 可以直接在 Github 仓库中直接提交 [Issue](https://github.com/esofar/cnblogs-theme-silence/issues) 或者 [Pull Requests](https://github.com/esofar/cnblogs-theme-silence/pulls) 。若您希望添加新的功能模块或者在使用体验方面有什么好的想法,可以在 [Gitter](https://gitter.im/cnblogs-theme-silence/community) 中讨论。 | ||
|
||
如果你在使用中发现 bug 可以通过 [Issue](https://github.com/esofar/cnblogs-theme-silence/issues) 进行反馈,或者可以直接提 [Pull Requests](https://github.com/esofar/cnblogs-theme-silence/pulls) 进行修复。另外,如果你在使用功能或交互体验方面有什么好的想法或其他问题,可以在 [Gitter](https://gitter.im/cnblogs-theme-silence/community) 中讨论,我会及时关注。 | ||
|
||
## 案例 | ||
|
||
您可以在 [演示案例](https://esofar.github.io/cnblogs-theme-silence/#/showcase) 中瞧瞧一些园友使用 Silence 主题的博客整体效果。 | ||
你可以在 [演示案例](https://esofar.github.io/cnblogs-theme-silence/#/showcase) 中看到一些正在使用该主题的园友博客。同时,如果若也目前也在使用该主题,并且希望展示给大家,可以在 [这里](https://github.com/esofar/cnblogs-theme-silence/issues/119) 提交申请,我会不定时更新。 | ||
|
||
## 赞赏 | ||
|
||
如果您觉得 Silence 主题做的还不错,或者想对我微小的工作一点激励,欢迎赞赏支持。 | ||
如果您觉得该主题做的还不错,想对我微小的工作一点激励,欢迎赞赏支持。 | ||
|
||
<div align="center"> | ||
|
||
![](./_media/sponsor.png) | ||
|
||
</div> | ||
|
||
## 许可 | ||
|
||
MIT © 2020 esofar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
* [部署指南](/guide) | ||
* [配置选项](/options) | ||
* [演示案例](/showcase) | ||
* [☕ 部署指南](/guide) | ||
* [🔨 配置选项](/options) | ||
* [🎉 演示案例](/showcase) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,116 @@ | ||
# 部署指南 | ||
# ☕ 部署指南 | ||
|
||
部署之前请先确认您的博客园账号已正常登陆,并且已联系管理员成功申请开通了 JS 权限。然后进入博客后台「设置」Tab页中完成下列配置。 | ||
请先确认你的博客园账号是否成功开通了 JS 权限,如未开通请邮件联系管理员申请。 | ||
|
||
## 获取库文件 | ||
JS权限开通后进入博客后台「设置」页中完成如下步骤配置。 | ||
|
||
因为该主题在 Github 上开源,可以直接使用 [jsDelivr](https://www.jsdelivr.com/) 提供的免费 CDN 服务获取 JS/CSS 文件。 | ||
## Step1:获取文件 | ||
|
||
主题必要的 CSS 和 JS 文件可以在 [已发行版本](https://github.com/esofar/cnblogs-theme-silence/releases) 的资源压缩包中获取,[点击](https://github.com/esofar/cnblogs-theme-silence/archive/refs/tags/v3.0.0-rc2.zip)下载最新版本(v3.0.0-rc2)。 | ||
``` | ||
└─dist | ||
└─silence.min.css | ||
└─silence.min.js | ||
``` | ||
|
||
另外,也可以借助开源 CDN [jsDelivr](https://www.jsdelivr.com/),以外链的方式直接获取。 | ||
|
||
``` | ||
https://fastly.jsdelivr.net/gh/esofar/[email protected]beta3/dist/silence.min.css | ||
https://fastly.jsdelivr.net/gh/esofar/[email protected]beta3/dist/silence.min.js | ||
https://fastly.jsdelivr.net/gh/esofar/[email protected]rc2/dist/silence.min.css | ||
https://fastly.jsdelivr.net/gh/esofar/[email protected]rc2/dist/silence.min.js | ||
``` | ||
> 已发行版本请参见 [releases](https://github.com/esofar/cnblogs-theme-silence/releases),建议使用最新版本。 | ||
|
||
## Step2:配置 CSS | ||
|
||
## 配置 CSS | ||
将 Step1 获取的 CSS 文件使用文本编辑器或浏览器打开,然后将全部内容复制粘贴到「页面定制 CSS 代码」处。 | ||
|
||
在「页面定制 CSS 代码」处,将上述获取的 CSS 样式文件外链通过浏览器打开,然后将代码全部粘贴到这里。 | ||
注意「禁用模板默认CSS」需要勾选。 | ||
|
||
![配置 CSS](_media/cfg-css.png) | ||
|
||
## 配置 JS | ||
## Step3:配置 JS | ||
|
||
在「博客侧边栏公告」处,配置用户选项并加载 JS 脚本文件。`window.$silence`取值请参见 [配置选项](/options?id=配置选项)。 | ||
将 Step1 获取的 JS 文件托管到博客园后台获取外链(也可以直接使用 jsDelivr 提供的访问地址),然后使用`<script>`标签引用。 | ||
|
||
![配置 JS](_media/cfg-js.png) | ||
|
||
## 配置 Loading | ||
接下来,放在「页脚 HTML 代码」处加载,`window.$silence` 用来配置用户选项,详请参见 [配置选项](/options?id=配置选项)。 | ||
|
||
在「页首 HTML 代码」处,从下面选择一种风格的 HTML 代码粘贴到这里。 | ||
![配置 JS](_media/cfg-js.png) | ||
|
||
![配置 Loading](_media/cfg-loading.png) | ||
|
||
- 亮色风格 | ||
<details> | ||
<summary>样例配置</summary> | ||
<pre> | ||
|
||
<script> | ||
window.$silence = { | ||
avatar: 'http://images.cnblogs.com/cnblogs_com/esofar/972540/o_avatar.jpg', | ||
favicon: 'https://files.cnblogs.com/files/esofar/favicon.ico', | ||
github: 'https://github.com/esofar', | ||
defaultTheme: 'e', | ||
navbars: [{ | ||
title: '标签', | ||
url: 'https://www.cnblogs.com/esofar/tag/' | ||
}, { | ||
title: '归档', | ||
url: 'https://www.cnblogs.com/esofar/p/' | ||
}, { | ||
title: '开源', | ||
chilren: [{ | ||
title: 'Silence', | ||
target: '_blank', | ||
url: 'https://github.com/esofar/cnblogs-theme-silence/', | ||
}, { | ||
title: 'Dddify', | ||
target: '_blank', | ||
url: 'https://github.com/esofar/dddify/', | ||
}] | ||
}], | ||
catalog: { | ||
enable: true, | ||
index: true, | ||
active: false, | ||
levels: ['h2', 'h3', 'h4'], | ||
}, | ||
signature: { | ||
enable: true, | ||
author: 'Esofar', | ||
license: ['署名-非商业性使用-相同方式共享 4.0 国际', 'https://creativecommons.org/licenses/by-nc-sa/4.0/'], | ||
}, | ||
sponsor: { | ||
enable: true, | ||
wechat: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_wechat.png', | ||
alipay: 'https://images.cnblogs.com/cnblogs_com/esofar/972540/o_alipay.png' | ||
} | ||
}; | ||
</script> | ||
<script src="https://fastly.jsdelivr.net/gh/esofar/[email protected]/dist/silence.min.js"></script> | ||
|
||
</pre> | ||
</details> | ||
|
||
|
||
## Step4:配置 Loading | ||
|
||
将如下代码粘贴到「页首 HTML 代码」处。 | ||
|
||
``` light | ||
<div class="light-loading"> | ||
``` | ||
<div class="loading"> | ||
<div class="box"> | ||
<h2>Loading</h2> | ||
<span></span><span></span><span></span><span></span><span></span><span></span><span></span> | ||
</div> | ||
</div> | ||
``` | ||
|
||
- 暗色风格 | ||
![](_media/cfg-tpl.png) | ||
|
||
``` dark | ||
<div class="dark-loading"> | ||
<div class="box"> | ||
<h2>Loading</h2> | ||
<span></span><span></span><span></span><span></span><span></span><span></span><span></span> | ||
</div> | ||
</div> | ||
``` | ||
> 为了避免因网络不好等情况导致页面加载卡顿,造成不好的用户体验,给页面添加 Loading 效果还是非常有必要的。 | ||
|
||
## 其他配置 | ||
## Step5:其他配置 | ||
|
||
1. 「标题」处设置博客标题,注意不支持显示「子标题」。 | ||
1. 「基本设置」栏中,「博客标题」处设置博客名称,默认不支持显示「博客子标题」,「博客皮肤」处需要选择标准模板`Custom`。 | ||
|
||
![](_media/cfg-title.png) | ||
|
||
2. 「博客皮肤」处选择标准模板`Custom`。 | ||
2. 「代码高亮」栏中,「渲染引擎」选择`highlight.js`,「显示行号」不要勾选,「主题样式」选择`cnblogs`。 | ||
|
||
![](_media/cfg-skin.png) | ||
|
||
3. 「禁用模板默认CSS」需要打对勾。 | ||
|
||
![](_media/cfg-tpl.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.