diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a68dd70f07b9b685e3ee95851938926f2ec5a9..809adf653e4d300ce8c19841667b2bcc5c807485 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### 1.1.3 (2019-07-22) + +### Features + +* Add the copy button in copyright of posts ([26155b7](https://github.com/liuyib/hexo-theme-stun/commit/26155b7)) +* Add a mark icon to external icon ([2f11fd7](https://github.com/liuyib/hexo-theme-stun/commit/2f11fd7)) +* Add support for front-matter: link ([79b73bf](https://github.com/liuyib/hexo-theme-stun/commit/79b73bf)) + ### 1.1.2 (2019-07-20) ### Bug Fixes diff --git a/docs/zh-CN/advanced/optimize.md b/docs/zh-CN/advanced/optimize.md index f09dac274b9d7509d1eea2ad678b744e5e045018..d078cc6ab864d8623421072b2048db8055bf8db7 100644 --- a/docs/zh-CN/advanced/optimize.md +++ b/docs/zh-CN/advanced/optimize.md @@ -1,6 +1,6 @@ # 优化建议 -## 打包、压缩文件 +## 打包、压缩资源文件 Stun 主题的源码中,`HTML`, `CSS`, `JavaScript`, `图片` 等资源文件是没有打包压缩的。**绝大部分的 Hexo 主题也是如此**。庆幸的是 Hexo 提供了相关的插件,来帮助用户解决这一问题。 diff --git a/docs/zh-CN/advanced/theme-config.md b/docs/zh-CN/advanced/theme-config.md index 566517e69380d4db7c21153c928fd56a32c7b3a5..ba3c2c071f90eb31bbf6168c80339bfcedad5afb 100644 --- a/docs/zh-CN/advanced/theme-config.md +++ b/docs/zh-CN/advanced/theme-config.md @@ -3,7 +3,7 @@ ::: tip 前言 - 修改配置文件、安装新的依赖等,都需要重启 hexo 服务器。 - 没有特别说明,配置项默认从 `v1.0.0` 版本开始支持。 -- 稳定的配置项使用 标明,表示基本不会变动;不稳定的配置项使用 标明,表示未来可能会变动甚至删除。 +- 稳定的配置使用 标明,表示基本不会变动。不稳定的配置使用 标明,表示未来可能会变动甚至删除。目前还不支持的配置使用 标明。最早开始支持的版本号使用 标明。与主题无关的配置项使用 标明。 ::: ## 配置文件 @@ -133,11 +133,11 @@ nav: `Front-matter` 在 Hexo 主题中,占据了极其重要的地位,如果你还不了解 `Front-matter`,可以查看这里:[https://hexo.io/zh-cn/docs/front-matter](https://hexo.io/zh-cn/docs/front-matter)。 -下面是 Hexo 中默认的 `Front-matter`,Stun 主题完美支持了它们(除了 `layout`)。 +下面是 Hexo 中默认提供的几种 `Front-matter` 属性。 -- `title` - 标题 -- `date` - 文件建立日期 -- `updated` - 文件更新日期 +- `title` - 标题 +- `date` - 文件建立日期 +- `updated` - 文件更新日期 例如: @@ -151,17 +151,17 @@ updated: 2019-5-16 10:23:46 ![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190722105740.png) -> Hexo 会帮你记录文件的更新日期,所以一般不需要手动指定 `updated` 字段。并且当你使用 `hexo new xxx` 指令生成文件时,Hexo 会帮你添加好 `title` 和 `date` 字段。因此这三个字段一般不需要手动设置。 +> Hexo 会帮你记录文件的更新日期,所以一般不需要手动指定 `updated` 属性。并且当你使用 `hexo new xxx` 指令生成文件时,Hexo 会帮你添加好 `title` 和 `date` 属性。因此这三个属性一般不需要手动设置。 -- `comments` - 是否开启评论功能 +- `comments` - 是否开启评论功能 -在 Stun 主题中,如果你启用了某个评论系统,默认是对所有通过 markdown 文件生成的页面(除首页,归档页,单个分类页,单个标签页以外的所有页面)生效。因此,你可以使用该字段单独设置某个页面 / 文章是否启用评论。 +在 Stun 主题中,如果你启用了某个评论系统,默认是对所有通过 markdown 文件生成的页面(除首页,归档页,单个分类页,单个标签页以外的所有页面)生效。因此,你可以使用该属性单独设置某个页面 / 文章是否启用评论。 -- `permalink` - 覆盖文章网址 +- `permalink` - 覆盖文章网址 -使用该字段可以为某篇文章单独指定一个网址。 +使用该属性可以为某篇文章单独指定一个网址。 -- `categories` - 设置文章分类 +- `categories` - 设置文章分类 你可以同时设置几个同级分类,例如: @@ -179,7 +179,7 @@ categories: - [foo, bar, baz] ``` -- `tags` - 设置文章标签 +- `tags` - 设置文章标签 标签只能设置为同级的。也就是说,如果你将标签设置为: @@ -190,35 +190,54 @@ tags: 那么它会被解析为 `foo,bar,baz`,也就是一个标签。 -- `layout` - 布局 +- `layout` - 布局 -> 该字段在相册页面中会用到,目前 Stun 还没有开发相册页面,所以暂时不支持此字段。 +> Stun 主题目前暂时还不支持,最近的版本中考虑进行支持。 + +还有几种 `Front-matter` 属性在 Hexo 文档中并没有出现(也许是 Hexo 的文档没有更新吧),但在官方提供的主题开发测试文件中出现。按照测试文件的要求,一个合格的 Hexo 都应该支持它们。这些属性如下: + +- `link` + +如果为某篇文章指定该属性,当点击该文章标题时,应该在新窗口或新的标签页中打开链接地址。 + +- `photos` + +> Stun 主题目前暂时还不支持,最近的版本中考虑进行支持。 + +用于指定一些图片,这些图片应该全部被显示在文章中。例如: + +``` yaml +photos: +- http://xxxxx1.jpg +- http://xxxxx2.jpg +- http://xxxxx3.jpg +``` --- -下面是 Stun 主题中,**特有的**几种 `Front-matter`。 +下面是 Stun 主题中,特有的几种 `Front-matter` 属性。 -- `top_image: https://xxxx.jpg` +- `top_image: https://xxxx.jpg` 用于设置文章顶部的大图。详情:[指定顶部图](http://localhost:8080/hexo-theme-stun/zh-CN/advanced/theme-config.html#指定顶部图) -- `toc_max_depth: 6` +- `toc_max_depth: 6` 用于设置文章中,解析标题生成目录的最大深度。取值 `1 ~ 6`。例如:`toc_max_depth: 3`,只会解析文中的 `h1`, `h2`, `h3` 来生成目录。详情:[文章目录](http://localhost:8080/hexo-theme-stun/zh-CN/advanced/theme-config.html#文章目录) -- `math: true` +- `math: true` 是否需要解析数学公式。详情:[数学公式](http://localhost:8080/hexo-theme-stun/zh-CN/advanced/third-part.html#数学公式) --- -下面是安装某些插件后,可以设置的 `Front-matter`。 +下面是安装某些插件后,可以设置的几种 `Front-matter` 属性。 -- `top: true` +- `top: true` 文章是否置顶。详情:[文章置顶](http://localhost:8080/hexo-theme-stun/zh-CN/advanced/theme-config.html#文章置顶) -- `no-emoji: true` +- `no-emoji: true` 是否解析文章中的 emoji 代码。详情:[添加-emoji-支持](http://localhost:8080/hexo-theme-stun/zh-CN/advanced/third-part.html#%E6%B7%BB%E5%8A%A0-emoji-%E6%94%AF%E6%8C%81) @@ -337,7 +356,7 @@ footer: # 是否启用 enable: true # 显示的文字信息,例如:xxx All Rights Reserved. - # 如果不设置,将显示 hexo 配置文件中的 author 字段的内容 + # 如果不设置,将显示 hexo 配置文件中的 author 属性的内容 text: # 开始时间(如果不设置,将显示最新的年份) since: @@ -506,7 +525,7 @@ toc: # 是否始终展开所有文章目录。true:始终展开,false:当文章中对应的标题到达顶部时自动展开。 expand_all: false # 生成目录时,解析 h 标签的最大深度。 - # 你可以在文章的 markdown 源文件的 Front-matter 中,通过添加 `toc_max_depth` 字段, + # 你可以在文章的 markdown 源文件的 Front-matter 中,通过添加 `toc_max_depth` 属性, # 来指定某篇文章生成目录时,解析 h 标签的最大深度。 max_depth: 6 ``` diff --git a/docs/zh-CN/advanced/third-part.md b/docs/zh-CN/advanced/third-part.md index ffda051746bb438aa514bb367b39d82fa252f9b7..dd72b84d9afdeaf5e9870d6e81c7ecb0dcca7e55 100644 --- a/docs/zh-CN/advanced/third-part.md +++ b/docs/zh-CN/advanced/third-part.md @@ -4,7 +4,7 @@ 第三方支持正在不断加入中 (๑•̀ㅂ•́)و✧ ::: -## 添加 Emoji 支持 +## 添加 Emoji 支持 如果想要使用 Emoji,你可以直接在[这里](http://emojihomepage.com/)复制粘贴使用。如果你更喜欢使用 Emoji 代码,例如:`:sparkles:` 将会显示为 :sparkles:, 那么你需要安装插件 [hexo-filter-github-emojis](https://github.com/crimx/hexo-filter-github-emojis) 来支持这种语法。 @@ -416,11 +416,11 @@ markdown: Stun 主题默认提供了一些 MathJax 和 Katex 的插件。 -- mhchem +- mhchem mhchem 是 MathJax 的插件,你可以使用这个插件来渲染化学方程式。详情请看:[MathJax/mhchem Manual](https://mhchem.github.io/MathJax-mhchem/)。 -- Copy-tex +- Copy-tex Copy-tex 是 KaTex 的插件,当启用这个插件之后,你只需要单击公式即可复制其源码。详情请看:[Copy-tex extension](https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex)。 diff --git a/package.json b/package.json index c3c70e43e2f261b78c323a826bded0a12c65e0d2..6ba59b2deb18a9ca43fbfffa40e2d99831603f1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-stun", - "version": "1.1.2", + "version": "1.1.3", "description": "A beautiful blog theme - stun", "homepage": "https://liuyib.github.io", "scripts": { diff --git a/source/js/utils.js b/source/js/utils.js index ad3e72cf1f7afe1b7d6287af7a5e09433301ef56..7d6e331ad6730cde8d18dc19a30622eb35e29c22 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -138,7 +138,6 @@ Stun.utils = Stun.$u = { } document.body.removeChild(input); } catch (e) { - console.log(e); return false; } },