hexo-theme-volantis 5.0.0-rc.8 → 5.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,10 +9,10 @@
9
9
  Check your environment:
10
10
 
11
11
  ```yaml
12
- Hexo: 4.2 ~ 5.x
13
- hexo-cli: 3.1 ~ 4.x
14
- node.js: 12.16 LTS ~ latest LTS
15
- npm: 6.13 ~ latest LTS
12
+ Hexo: 5.4 ~ 6.x
13
+ hexo-cli: 4.x
14
+ node.js: 16.x LTS ~ latest LTS
15
+ npm: 8.x ~ latest LTS
16
16
  ```
17
17
 
18
18
  Edit your `_config.yml`:
package/_config.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ############################### Volantis ###############################
2
2
  info:
3
3
  theme_name: Volantis # This is theme's name.
4
- theme_version: '5.0.0-rc.8' # This is theme's version.
4
+ theme_version: '5.0.0-rc.9' # This is theme's version.
5
5
  theme_docs: https://volantis.js.org/ # This is theme's URL.
6
6
  theme_repo: https://github.com/volantis-x/hexo-theme-volantis
7
7
  # Debug 调试模式
@@ -1043,7 +1043,7 @@ color_scheme:
1043
1043
  # 主题色
1044
1044
  theme: '#3dd9b6'
1045
1045
  # 链接色
1046
- link: '#1b79c4'
1046
+ link: '#2092ec'
1047
1047
  # 按钮色
1048
1048
  button: '#44D7B6'
1049
1049
  # 鼠标放到交互元素上时的色
@@ -1100,11 +1100,11 @@ color_scheme:
1100
1100
  # 卡片背景色 # Dark Grey 3
1101
1101
  card: '#262626'
1102
1102
  # 网站背景上的文字
1103
- site_inner: '#eee'
1103
+ site_inner: '#eeeeeede'
1104
1104
  # 网站页脚文字
1105
- site_footer: '#aaa'
1105
+ site_footer: '#aaaaaade'
1106
1106
  # 卡片上的普通文字
1107
- text: '#eee'
1107
+ text: '#eeeeeede'
1108
1108
 
1109
1109
  # 区块和代码块背景色 # Dark Grey 4
1110
1110
  block: '#434343'
@@ -1113,21 +1113,21 @@ color_scheme:
1113
1113
  # 行内代码颜色
1114
1114
  inlinecode: '#D56D28'
1115
1115
 
1116
- # 文章部分
1117
- h1: '#f5f5f5' # Dark Grey 8
1118
- h2: '#f5f5f5'
1119
- h3: '#f0f0f0' # Dark Grey 7
1120
- h4: '#f0f0f0'
1121
- h5: '#f0f0f0'
1122
- h6: '#f0f0f0'
1123
- p: '#d9d9d9e6' # Dark Grey 6
1116
+ # 文章部分 高强度文本的不透明度应为87% 中等重点文字适用于60%
1117
+ h1: '#FFFFFFde' # Dark Grey 8
1118
+ h2: '#FFFFFFde'
1119
+ h3: '#FFFFFF99' # Dark Grey 7
1120
+ h4: '#FFFFFF99'
1121
+ h5: '#FFFFFF99'
1122
+ h6: '#FFFFFF99'
1123
+ p: '#d9d9d9de' # Dark Grey 6
1124
1124
 
1125
1125
  # 列表文字 # Dark Grey 6
1126
- list: '#d9d9d9d9'
1126
+ list: '#d9d9d9de'
1127
1127
  # 列表 hover 时的文字
1128
1128
  list_hl: 'mix($color-theme, #fff, 80)'
1129
1129
  # 辅助性文字 # Dark Grey 5
1130
- meta: '#bfbfbf'
1130
+ meta: '#bfbfbfde'
1131
1131
  # 夜间图片亮度
1132
1132
  brightness: 70%
1133
1133
  ############################### Color Scheme ############################### > end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-volantis",
3
- "version": "5.0.0-rc.8",
3
+ "version": "5.0.0-rc.9",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -7,6 +7,7 @@ hexo.on('generateBefore', () => {
7
7
  require('./lib/config')(hexo);
8
8
  require('./lib/stellar-tag-utils')(hexo);
9
9
  require('./lib/render-stylus')(hexo);
10
+ require('./lib/check-environment')(hexo);
10
11
  });
11
12
 
12
13
  hexo.on('ready', () => {
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+ const exec = require('child_process').exec;
3
+ module.exports =(hexo) => {
4
+ if (!hexo.checkEnvironment) {
5
+ hexo.checkEnvironment=1;
6
+ hexo.log.info(`Checking environment configuration...`);
7
+ exec('node -v', (err, stdout, stderr) => {
8
+ if (err) {
9
+ CheckError(hexo,`node.js: ${err}`);
10
+ }
11
+ let nodeVersion = stdout.match(/v(\d*)/)[1];
12
+ if (nodeVersion<14) {
13
+ hexo.log.info(`node.js 版本:${stdout}`);
14
+ CheckError(hexo,`node.js 版本过低,请升级至 v14.x 以上版本!`);
15
+ }else{
16
+ exec('hexo -v', (err, stdout, stderr) => {
17
+ if (err) {
18
+ CheckError(hexo,`hexo-cli: ${err}`);
19
+ }
20
+ let hexoVersion1 = stdout.match(/hexo:\s*(\d*)/)[1];
21
+ let hexoVersion2 = stdout.match(/hexo:\s*\d*\.(\d*)/)[1];
22
+ if (hexoVersion1<5 || (hexoVersion1==5 && hexoVersion2<4)) {
23
+ hexo.log.info(`hexo 版本:${stdout}`);
24
+ CheckError(hexo,`hexo 版本过低,请升级至 5.4 以上版本!`);
25
+ }else{
26
+ let hexoClVersion1 = stdout.match(/hexo-cli:\s*(\d*)/)[1];
27
+ let hexoClVersion2 = stdout.match(/hexo-cli:\s*\d*\.(\d*)/)[1];
28
+ if (hexoClVersion1<4 || (hexoClVersion1==4 && hexoClVersion2<1)) {
29
+ hexo.log.info(`hexo-cli 版本:${stdout}`);
30
+ CheckError(hexo,`hexo-cli 版本过低,请升级至 4.1 以上版本!`);
31
+ }else{
32
+ hexo.log.info(`Check environment configuration success!`);
33
+ }
34
+ }
35
+ });
36
+ }
37
+ });
38
+ }
39
+ };
40
+
41
+ function CheckError(hexo,msg) {
42
+ hexo.log.error(`
43
+ ============================================================
44
+ 环境配置检查失败!| Environment configuration check failed!
45
+ ============================================================
46
+ ${msg}
47
+ ============================================================
48
+ 推荐的配置:
49
+ Hexo: 5.4 ~ 6.x
50
+ hexo-cli: 4.3 ~ latest
51
+ node.js: 16.x LTS ~ latest LTS
52
+ npm: 8.x ~ latest LTS
53
+ ============================================================`);
54
+ throw new Error('环境配置检查失败!| Environment configuration check failed!');
55
+ }
@@ -48,4 +48,27 @@ function postNoteBlock(args, content) {
48
48
  }
49
49
 
50
50
  hexo.extend.tag.register('note', postNote);
51
- hexo.extend.tag.register('noteblock', postNoteBlock, {ends: true});
51
+
52
+ // https://github.com/volantis-x/hexo-theme-volantis/issues/712
53
+ // {% blocknote style, title %}
54
+ // content
55
+ // {% endblocknote %}
56
+ hexo.extend.tag.register('blocknote', postNoteBlock, {ends: true});
57
+ // 兼容 noteblock
58
+ hexo.extend.filter.register('before_post_render', function(data) {
59
+ data.content = data.content.replace(/{%\s+noteblock(.*)%}/g, (p,q)=>{
60
+ return `{% blocknote ${q} %}`
61
+ });
62
+ data.content = data.content.replace(/{%\s+endnoteblock\s+%}/g, '{% endblocknote %}');
63
+ return data;
64
+ });
65
+ // 兼容 noteblock 失败
66
+ hexo.extend.tag.register('noteblock', postNoteBlockDeprecated, {ends: true});
67
+ function postNoteBlockDeprecated(args, content) {
68
+ throw new Error(`
69
+ ==================================================================================
70
+ {% noteblock %} is deprecated. Use {% blocknote %} instead.
71
+ see: https://github.com/volantis-x/hexo-theme-volantis/issues/712
72
+ ==================================================================================
73
+ `);
74
+ }