11# hexo 极简风格主题
22
3+ <div align =" right " >
4+ <img src =" https://img.shields.io/badge/-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-A31F34?style=for-the-badge " alt =" 简体中文 " >
5+ <a title =" en " href =" README_EN.md " ><img src =" https://img.shields.io/badge/-English-545759?style=for-the-badge " alt =" english " ></a >
6+ </div >
7+
38[ ![ Lint Status] ( https://github.com/f-dong/hexo-theme-minimalism/workflows/Test/badge.svg )] ( https://github.com/f-dong/hexo-theme-minimalism/actions/workflows/test.yml )
49[ ![ Lint Status] ( https://github.com/f-dong/hexo-theme-minimalism/workflows/Lint/badge.svg )] ( https://github.com/f-dong/hexo-theme-minimalism/actions/workflows/lint.yml )
510[ ![ NPM version] ( https://img.shields.io/npm/v/hexo-theme-minimalism?color=red&logo=npm&style=flat-square )] ( https://www.npmjs.com/package/hexo-theme-minimalism )
611[ ![ Github License] ( https://img.shields.io/github/license/f-dong/hexo-theme-minimalism.svg?style=flat-square )] ( https://github.com/f-dong/hexo-theme-minimalism/blob/main/LICENSE )
712[ ![ Node.js Version] ( https://img.shields.io/badge/node-%3E=12.0-success.svg?style=flat-square&logo=Node.js&longCache=true )] ( https://hexo.io )
813[ ![ Required Hexo version] ( https://img.shields.io/badge/hexo-%3E=5.0.0-blue?style=flat-square&logo=hexo )] ( https://hexo.io )
914
10-
15+ 一个简单且轻量级的 Hexo 暗/亮模式主题。你可以点击 [ 这里 ] ( https://minimalism.codeover.cn/docs/start ) 查看快速入门说明和文档。
1116
1217![ 预览图片] ( https://user-images.githubusercontent.com/40230452/189160566-c4f4070a-a64e-4843-81eb-7885c45f71c3.png )
1318
14- * [ 预览] ( #预览 )
15- * [ 特性] ( #特性 )
16- * [ 下载] ( #下载 )
17- * [ 配置] ( #配置 )
18- * [ 切换主题] ( #切换主题 )
19- * [ \_ config\. yml 文件的其它修改建议:] ( #_configyml-文件的其它修改建议 )
20- * [ 新建标签 tags 页] ( #新建标签-tags-页 )
21- * [ 新建关于我 about 页] ( #新建关于我-about-页 )
22- * [ 新建标签 categories 页(可选的)] ( #新建标签-categories-页可选的 )
23- * [ 菜单导航配置] ( #菜单导航配置 )
24- * [ 配置基本菜单导航的名称、路径url和图标icon\. ] ( #配置基本菜单导航的名称路径url和图标icon )
25- * [ 代码高亮] ( #代码高亮 )
26- * [ 脚注] ( #脚注 )
27- * [ 中文链接转拼音(建议安装)] ( #中文链接转拼音建议安装 )
28- * [ 添加emoji表情支持(可选的)] ( #添加emoji表情支持可选的 )
29- * [ 添加 RSS 订阅支持(可选的)] ( #添加-rss-订阅支持可选的 )
30- * [ 文章 Front\- matter 介绍] ( #文章-front-matter-介绍 )
31- * [ Front\- matter 选项详解] ( #front-matter-选项详解 )
32- * [ 最简示例] ( #最简示例 )
33- * [ 最全示例] ( #最全示例 )
34- * [ 效果截图] ( #效果截图 )
35- * [ License] ( #license )
19+ ## 关于 Minimalism
20+
21+ Minimalism 是一个简单且轻量级的 Hexo 暗/亮模式主题。它只使用 CSS 和 纯原生 JS,没有使用不必要的第三方「渲染阻塞」库。
22+
23+ ## 在线演示
24+
25+ https://www.codeover.cn
3626
37- Table of contents generated with [ gh-md-toc ] ( https://github.com/ekalinin/github-markdown-toc.go )
27+ 如果你也在使用 Minimalism,欢迎 [ 提交 issues ] ( https://github.com/f-dong/hexo-theme-minimalism/issues/new?title=[%E6%B7%BB%E5%8A%A0%E6%BC%94%E7%A4%BA%E7%AB%99] ) 添加你的博客链接。
3828
39- [ TODO list ] ( ./TODO.md )
29+ ## 简洁性
4030
41- ## 预览
31+ 简洁是必须的!当决定个人博客使用 Hexo 时,主要是为了找到一个简单和干净的设计,不需要花哨的外观、不必要的图片和颜色。想要一个专注于文章内容的博客,而不是将读者的注意力转向「杂乱无章」的用户界面。我在 Hexo 主题页面上发现了许多漂亮的主题,但最终决定制作自己的主题。
4232
43- - [ codeover.cn ] ( https://www.codeover.cn )
33+ ## 轻量级
4434
35+ 「轻量级」意味着该主题尽可能少地使用设计元素。较少的 JavaScript 和 CSS 文件。Minimalism 仅使用 CSS 和 纯原生 JS,主题本身不依赖任何第三方库。以下是使用 Minimalism 主题的博客的「粗略」性能表现:
36+
37+ ![ 性能表现] ( https://user-images.githubusercontent.com/40230452/235286716-5d7e6f38-f1fd-411b-9bc7-836e12c657f7.png )
38+
39+ ## 文档
40+
41+ 请阅读 [ Minimalism 主题文档] ( https://minimalism.codeover.cn/docs/start ) 进行主题配置与安装,非常简单易懂。
4542
4643## 特性
4744
@@ -51,295 +48,18 @@ Table of contents generated with [gh-md-toc](https://github.com/ekalinin/github-
5148- 响应式设计,博客在桌面端、平板、手机等设备上均能很好的展现
5249- 独特的分类归档页
5350- [ Gitalk] ( https://gitalk.github.io/ ) 评论模块支持, 集成了谷歌分析(` Google Analytics ` )
54- - 支持` emoji ` 表情,用` markdown emoji ` 语法书写直接生成对应的能 ** 跳跃 ** 的表情
51+ - 支持` emoji ` 表情,用` markdown emoji ` 语法书写直接生成对应的表情
5552- 语义化标签, 更易于 SEO 优化, 提升博客价值
5653
5754
55+ ## 支持
5856
59- ## 下载
60-
61- 本主题** 推荐你使用 Hexo 5.0.0 及以上的版本** 。如果,你已经有一个自己的 [ Hexo] ( https://hexo.io/zh-cn/ ) 博客了,建议你将 Hexo 升级到最新稳定的版本。
62-
63- 点击 [ 这里] ( https://codeload.github.com/f-dong/hexo-theme-minimalism/zip/master ) 下载 ` master ` 分支的最新稳定版的代码,解压缩后,将 ` hexo-theme-minimalism ` 的文件夹复制到你 Hexo 的 ` themes ` 文件夹中即可。
64-
65- 当然你也可以在你的 ` themes ` 文件夹下使用 ` git clone ` 命令来下载:
66-
67- ``` bash
68- git clone https://github.com/f-dong/hexo-theme-minimalism.git
69- ```
70-
71- ## 配置
72-
73- ### 切换主题
74-
75- 修改 Hexo 根目录下的 ` _config.yml ` 的 ` theme ` 的值:` theme: hexo-theme-minimalism `
76-
77- #### ` _config.yml ` 文件的其它修改建议:
78-
79- - 请修改 ` _config.yml ` 的 ` url ` 的值为你的网站主 ` URL ` (如:` http://xxx.github.io ` )。
80- - 建议修改两个 ` per_page ` 的分页条数值为 ` 6 ` 的倍数,如:` 12 ` 、` 18 ` 等,这样文章列表在各个屏幕下都能较好的显示。
81- - 建议修改 ` language ` 的值为 ` zh-CN ` , 否则部分浏览器将弹出翻译窗口
82-
83- ### 新建标签 tags 页
84-
85- tags 页是用来展示所有标签的页面, 如果在你的博客 source 目录下还没有 tags/index.md 文件, 那么你就需要新建一个, 命令如下:
86-
87- ``` bash
88- hexo new page " tags"
89- ```
90-
91- 编辑你刚刚新建的页面文件 ` /source/tags/index.md ` ,至少需要以下内容:
92-
93- ``` yaml
94- ---
95- title : tags
96- date : 2022-04-26 22:59:30
97- type : " tags"
98- layout : " tags"
99- ---
100- ```
101-
102- ### 新建关于我 about 页
103-
104- ` about ` 页是用来展示** 关于我和我的博客** 信息的页面,如果在你的博客 ` source ` 目录下还没有 ` about/index.md ` 文件,那么你就需要新建一个,命令如下:
105-
106- ``` bash
107- hexo new page " about"
108- ```
109-
110- 编辑你刚刚新建的页面文件 ` /source/about/index.md ` ,至少需要以下内容:
111-
112- ``` yaml
113- ---
114- title : about
115- date : 2022-04-26 22:59:30
116- ---
117- ```
118-
119-
120- ### 新建标签 categories 页(可选的)
121-
122- 本主题内置了一个 ` categories ` 归档页, 用于显示分类下的所有文章, 如果在你的博客 ` source ` 目录下还没有 ` tags/categories.md ` 文件, 那么你就需要新建一个, 命令如下:
123-
124- ``` bash
125- hexo new page " categories"
126- ```
127-
128- 编辑你刚刚新建的页面文件 ` /source/categories/index.md ` , 至少需要以下内容:
129-
130- ``` yaml
131- ---
132- title : categories
133- date : 2022-04-26 22:59:30
134- type : " categories"
135- layout : " categories"
136- ---
137- ```
138-
139-
140-
141- ### 菜单导航配置
142-
143- #### 配置基本菜单导航的名称、路径url和图标icon.
144-
145- 1 . 菜单导航名称可以是中文也可以是英文(如:` Index ` 或 ` 主页 ` )
146- 2 . ` External ` 表示是否在新标签页打开连接
147- 3 . 导航地址可以是站内地址也可以是外网地址
148-
149- ``` yaml
150- menu :
151- Index :
152- url : /
153- External : false
154- name : 首页
155- Tags :
156- url : /tags
157- External : false
158- name : 标签
159- # Categories:
160- # url: /categories
161- # External: false
162- # name: 分类
163- Archives :
164- url : /archives
165- External : false
166- name : 归档
167- About :
168- url : /about
169- External : false
170- name : 关于
171- ` ` `
172-
173- ### 代码高亮
57+ 欢迎 ** pull request** 或者 提交 ** issues** .
17458
175- 从 Hexo5.0 版本开始自带了 ` prismjs` 代码语法高亮的支持,本主题对此进行了改造支持 。
59+ 17660
177- 如果你的博客中曾经安装过 `hexo-prism-plugin` 的插件,那么你须要执行 `npm uninstall hexo-prism-plugin` 来卸载掉它,否则生成的代码中会有 `{` 和 `}` 的转义字符。
178-
179- 然后,修改 Hexo 根目录下 `_config.yml` 文件中 `highlight.enable` 的值为 `false`,并将 `prismjs.enable` 的值设置为 `true`,主要配置如下:
180-
181- ` ` ` yaml
182- highlight:
183- enable: false
184- line_number: true
185- auto_detect: false
186- tab_replace: ''
187- wrap: true
188- hljs: false
189- prismjs:
190- enable: true
191- preprocess: true
192- line_number: true
193- tab_replace: ''
194- ` ` `
195-
196- 主题中默认的 `prismjs` 主题是 `Tomorrow Night`,如果你想定制自己的主题,可以前往 [prismjs 下载页面](https://prismjs.com/download.html) 定制下载自己喜欢的主题 `css` 文件,然后将此 css 主题文件取名为 `prism.css`,替换掉 `hexo-theme-minimalism` 主题文件夹中的 `source/style/prism.css` 文件即可。
197-
198-
199- # ## 脚注
200-
201- 可以附在文章页面的最底端的,对某些东西加以说明,印在书页下端的注文。 脚注和尾注是对文本的补充说明。
202-
203- 本主题支持 `markdown` 语法的脚注,使用方法如下:
204-
205- ` ` ` markdown
206- 基本脚注[^1]
207- 这是一个内联脚注[^2](内联脚注)
208- 另一个[^3]
209- 另一个[^4]
210-
211-
212- [^1]: 基本脚注内容
213- [^3]: 段落
214- 脚注
215- 内容
216- [^4]: 一些脚注内容 [markdown](https://en.wikipedia.org/wiki/Markdown)
217- ` ` `
218-
219- [点击这里](https://www.codeover.cn/hexo-footnotes/) 查看示例
220-
221- - 默认不过滤代码块内的脚注,即在代码块内的脚注也会被渲染出来。如果你需要过滤代码块内的脚注,可以在主题配置文件 `_config.yml` 中设置 `footnote.ignoreCodeBlock` 的值为 `true`。
222- - 如需禁用脚注,可在主题配置文件 `_config.yml` 中设置 `footnote.enable` 的值为 `false`
223- - 本功能参考了 [hexo-reference](https://github.com/kchen0x/hexo-reference)
224-
225- # ## 中文链接转拼音(建议安装)
226-
227- 如果你的文章名称是中文的,那么 Hexo 默认生成的永久链接也会有中文,这样不利于 `SEO`。我们可以用 [hexo-permalink-pinyin](https://github.com/viko16/hexo-permalink-pinyin) Hexo 插件使在生成文章时生成中文拼音的永久链接。
228-
229- 安装命令如下:
230-
231- ` ` ` bash
232- npm i hexo-permalink-pinyin --save
233- ` ` `
234-
235- 在 Hexo 根目录下的 `_config.yml` 文件中,新增以下的配置项:
236-
237- ` ` ` yaml
238- permalink_pinyin:
239- enable: true
240- separator: '-' # default: '-'
241- ` ` `
242-
243- > **注**:除了此插件外,[hexo-abbrlink](https://github.com/rozbo/hexo-abbrlink) 插件也可以生成非中文的链接。
244-
245- # ## 添加emoji表情支持(可选的)
246-
247- 本主题新增了对`emoji`表情的支持,使用到了 [hexo-filter-github-emojis](https://npm.taobao.org/package/hexo-filter-github-emojis) 的 Hexo 插件来支持 `emoji`表情的生成,把对应的`markdown emoji`语法(`::`,例如:`:smile:`)转变成会跳跃的`emoji`表情,安装命令如下:
248-
249- ` ` ` bash
250- npm install hexo-filter-github-emojis --save
251- ` ` `
252-
253- 在 Hexo 根目录下的 `_config.yml` 文件中,新增以下的配置项:
254-
255- ` ` ` yaml
256- githubEmojis:
257- enable: true
258- className: github-emoji
259- inject: false
260- styles:
261- customEmojis:
262- ` ` `
263- 执行 `hexo clean && hexo g` 重新生成博客文件,然后就可以在文章中对应位置看到你用`emoji`语法写的表情了。
264-
265- # ## 添加 RSS 订阅支持(可选的)
266-
267- 本主题中还使用到了 [hexo-generator-feed](https://github.com/hexojs/hexo-generator-feed) 的 Hexo 插件来做 `RSS`,安装命令如下:
268-
269- ` ` ` bash
270- npm install hexo-generator-feed --save
271- ` ` `
272-
273- 在 Hexo 根目录下的 `_config.yml` 文件中,新增以下的配置项:
274-
275- ` ` ` yaml
276- feed:
277- type: atom
278- path: atom.xml
279- limit: 20
280- hub:
281- content:
282- content_limit: 140
283- content_limit_delim: ' '
284- order_by: -date
285- ` ` `
286-
287- 执行 `hexo clean && hexo g` 重新生成博客文件,然后在 `public` 文件夹中即可看到 `atom.xml` 文件,说明你已经安装成功了。
288-
289- # # 文章 Front-matter 介绍
290-
291- # ## Front-matter 选项详解
292-
293- ` Front-matter` 选项中的所有内容均为**非必填**的。但我仍然建议至少填写 `title` 和 `date` 的值。
294-
295- | 配置选项 | 默认值 | 描述 |
296- | ---------- | -------------------------- | ------------------------------------------------------------ |
297- | title | `Markdown` 的文件标题 | 文章标题,强烈建议填写此选项 |
298- | date | 文件创建时的日期时间 | 发布时间,强烈建议填写此选项,且最好保证全局唯一 |
299- | img | `featureImages` 中的某个值 | 文章特征图,推荐使用图床(腾讯云、七牛云、又拍云等)来做图片的路径.如 : ` http://xxx.com/xxx.jpg` |
300- | top | `true` | 推荐文章(文章是否置顶),如果 `top` 值为 `true`,则会作为首页推荐文章 |
301- | hide | `false` | 隐藏文章,如果`hide`值为`true`,则文章不会在首页显示 |
302- | cover | `false` | `v1.0.2`版本新增,表示该文章是否需要加入到首页轮播封面中 |
303- | toc | `true` | 是否开启 TOC,可以针对某篇文章单独关闭 TOC 的功能。前提是在主题的 `config.yml` 中激活了 `toc` 选项 |
304- | summary | 无 | 文章摘要,自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字 |
305- | description | 无 | 用于搜索引擎的 description,如果没值则取 summary 或 截取文章内容 |
306- | categories | 无 | 文章分类,本主题的分类表示宏观上大的分类,只建议一篇文章一个分类 |
307- | tags | 无 | 文章标签,一篇文章可以多个标签 |
308- | keywords | 文章标题 | 文章关键字,SEO 时需要 |
309- | categories | 文章分类 | 当前文章的所属分类 用户分类归档页 |
310- | tags | 文章标签 | 可以有多个 |
311-
312- 以下为文章的 `Front-matter` 示例。
313-
314- # ## 最简示例
315-
316- ` ` ` yaml
317- ---
318- title: typora-vue-theme主题介绍
319- date: 2022-04-26 09:25:00
320- ---
321- ` ` `
322-
323- # ## 最全示例
324-
325- ` ` ` yaml
326- ---
327- title: typora-vue-theme主题介绍
328- date: 2022-04-26 09:25:00
329- author: 张三
330- img: /source/images/xxx.jpg
331- top: true
332- hide: false
333- cover: true
334- toc: false
335- summary: 这是你自定义的文章摘要内容,如果这个属性有值,文章卡片摘要就显示这段文字,否则程序会自动截取文章的部分内容作为摘要
336- description: 该值主要用于 seo 优化,设置后页面 description 将显示该值,未设置则取 summary 或截取部分文章内容
337- categories: Markdown
338- tags:
339- - Typora
340- - Markdown
341- ---
342- ` ` `
61+ 如果你觉得主题还不错的话,欢迎给我 Github 点个 Star,谢谢!
34362
34463## License
64+
34565MIT
0 commit comments