hexo-theme-ayeria 1.9.11 → 1.9.13

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.
Files changed (95) hide show
  1. package/LICENSE +37 -37
  2. package/README.en.md +560 -560
  3. package/README.md +560 -560
  4. package/_config.yml +271 -271
  5. package/_scaffolds/post.md +8 -8
  6. package/index.js +11 -2
  7. package/languages/de.yml +39 -39
  8. package/languages/default.yml +40 -39
  9. package/languages/en.yml +40 -39
  10. package/languages/es.yml +39 -39
  11. package/languages/fr.yml +39 -39
  12. package/languages/ja.yml +39 -39
  13. package/languages/ko.yml +39 -39
  14. package/languages/nl.yml +39 -39
  15. package/languages/no.yml +39 -39
  16. package/languages/pt.yml +39 -39
  17. package/languages/ru.yml +39 -39
  18. package/languages/vi.yml +39 -39
  19. package/languages/zh-CN.yml +40 -39
  20. package/languages/zh-TW.yml +40 -39
  21. package/layout/_partial/ads.ejs +8 -8
  22. package/layout/_partial/after-footer.ejs +84 -84
  23. package/layout/_partial/archive-post.ejs +13 -13
  24. package/layout/_partial/archive.ejs +61 -61
  25. package/layout/_partial/article.ejs +94 -94
  26. package/layout/_partial/ayeria.ejs +53 -53
  27. package/layout/_partial/baidu-analytics.ejs +11 -11
  28. package/layout/_partial/broadcast.ejs +19 -19
  29. package/layout/_partial/float-btns.ejs +7 -7
  30. package/layout/_partial/footer.ejs +61 -61
  31. package/layout/_partial/google-analytics.ejs +10 -10
  32. package/layout/_partial/head.ejs +64 -68
  33. package/layout/_partial/katex.ejs +21 -21
  34. package/layout/_partial/lock.ejs +37 -37
  35. package/layout/_partial/mathjax.ejs +18 -18
  36. package/layout/_partial/modal.ejs +70 -76
  37. package/layout/_partial/music.ejs +15 -15
  38. package/layout/_partial/post/albums.ejs +16 -16
  39. package/layout/_partial/post/author.ejs +7 -7
  40. package/layout/_partial/post/busuanzi.ejs +4 -4
  41. package/layout/_partial/post/category.ejs +9 -9
  42. package/layout/_partial/post/clipboard.ejs +54 -54
  43. package/layout/_partial/post/date.ejs +2 -2
  44. package/layout/_partial/post/gallery.ejs +15 -15
  45. package/layout/_partial/post/giscus.ejs +40 -40
  46. package/layout/_partial/post/gitalk.ejs +12 -12
  47. package/layout/_partial/post/justifiedGallery.ejs +8 -8
  48. package/layout/_partial/post/nav.ejs +22 -22
  49. package/layout/_partial/post/search.ejs +3 -3
  50. package/layout/_partial/post/share.ejs +53 -53
  51. package/layout/_partial/post/tag.ejs +5 -5
  52. package/layout/_partial/post/title.ejs +16 -16
  53. package/layout/_partial/post/tocbot.ejs +6 -6
  54. package/layout/_partial/post/topping.ejs +2 -2
  55. package/layout/_partial/post/twikoo.ejs +7 -7
  56. package/layout/_partial/post/valine.ejs +48 -48
  57. package/layout/_partial/post/word.ejs +19 -19
  58. package/layout/_partial/sidebar.ejs +48 -48
  59. package/layout/_partial/viewer.ejs +105 -105
  60. package/layout/categories.ejs +8 -8
  61. package/layout/friends.ejs +19 -19
  62. package/layout/index.ejs +4 -4
  63. package/layout/layout.ejs +35 -30
  64. package/layout/page.ejs +2 -2
  65. package/layout/plain-page.ejs +4 -4
  66. package/layout/post.ejs +2 -2
  67. package/layout/tags.ejs +88 -88
  68. package/package.json +39 -39
  69. package/scripts/default_config.js +6 -6
  70. package/scripts/events/index.js +11 -11
  71. package/scripts/events/lib/hello.js +38 -38
  72. package/scripts/events/lib/merge-configs.js +28 -28
  73. package/scripts/filters/index.js +13 -13
  74. package/scripts/filters/meta_generator.js +17 -17
  75. package/scripts/helpers/ayeria-plus-vendors.js +9 -9
  76. package/scripts/helpers/category-tree.js +90 -90
  77. package/scripts/helpers/wordcount.js +39 -39
  78. package/scripts/lib/core.js +25 -25
  79. package/scripts/utils/join-path.js +12 -12
  80. package/scripts/utils/object.js +31 -31
  81. package/source/404.html +187 -187
  82. package/source/css/ayeria-layout.styl +48 -48
  83. package/source/css/clipboard.styl +37 -37
  84. package/source/css/custom.styl +17 -17
  85. package/source/css/fonts/remixicon.css +1816 -1816
  86. package/source/css/fonts/remixicon.svg +5329 -5329
  87. package/source/data/random-sentences.txt +2629 -141
  88. package/source/dist/main.css +1 -1
  89. package/source/dist/main.js +1 -1
  90. package/source/js/clickBoom1.js +152 -152
  91. package/source/js/clickBoom2.js +180 -180
  92. package/source/js/jquery-3.6.0.min.js +2 -2
  93. package/source/js/lazyload.min.js +7 -7
  94. package/source/js/search.js +126 -126
  95. package/source/js/random-sentences.js +0 -166
package/layout/tags.ejs CHANGED
@@ -1,88 +1,88 @@
1
- <section class="outer">
2
- <% if (site.tags.length) { %>
3
- <h1 class="page-type-title"><%= __('tags') %></h1>
4
-
5
- <% var tagList = site.tags.sort('name'); %>
6
-
7
- <div class="tag-cloud">
8
- <div class="tag-cloud-header">
9
- <span class="tag-cloud-stats">
10
- 共 <strong><%= site.tags.length %></strong> 个标签,<strong><%= site.posts.length %></strong> 篇文章
11
- </span>
12
- <div class="tag-cloud-controls">
13
- <div class="tag-cloud-search">
14
- <input type="text"
15
- class="tag-cloud-input"
16
- placeholder="搜索标签…"
17
- aria-label="搜索标签" />
18
- </div>
19
- <div class="tag-cloud-sort">
20
- <button type="button" class="tag-sort-btn is-active" data-sort="name">名称</button>
21
- <button type="button" class="tag-sort-btn" data-sort="count">热度</button>
22
- </div>
23
- </div>
24
- </div>
25
-
26
- <div class="tag-cloud-wrap">
27
- <% tagList.each(function(tag) { %>
28
- <a class="tag-cloud-item"
29
- href="<%- url_for(tag.path) %>"
30
- data-count="<%= tag.posts.length %>"
31
- data-name="<%= tag.name.toLowerCase() %>">
32
- <span class="tag-cloud-name"><%= tag.name %></span>
33
- <span class="tag-cloud-count"><%= tag.posts.length %> 篇文章</span>
34
- </a>
35
- <% }); %>
36
- </div>
37
-
38
- <p class="tag-cloud-empty">没有匹配的标签</p>
39
- </div>
40
- <% } %>
41
- </section>
42
-
43
- <script>
44
- (function () {
45
- var wrap = document.querySelector('.tag-cloud-wrap');
46
- if (!wrap) return;
47
-
48
- var allItems = Array.prototype.slice.call(wrap.querySelectorAll('.tag-cloud-item'));
49
- var input = document.querySelector('.tag-cloud-input');
50
- var sortBtns = document.querySelectorAll('.tag-sort-btn');
51
- var empty = document.querySelector('.tag-cloud-empty');
52
-
53
- if (input) {
54
- var timer;
55
- input.addEventListener('input', function () {
56
- clearTimeout(timer);
57
- var self = this;
58
- timer = setTimeout(function () {
59
- var q = self.value.trim().toLowerCase();
60
- var visible = 0;
61
- allItems.forEach(function (el) {
62
- var match = !q || el.getAttribute('data-name').indexOf(q) !== -1;
63
- el.style.display = match ? '' : 'none';
64
- if (match) visible++;
65
- });
66
- if (empty) empty.style.display = visible ? 'none' : '';
67
- }, 120);
68
- });
69
- }
70
-
71
- sortBtns.forEach(function (btn) {
72
- btn.addEventListener('click', function () {
73
- sortBtns.forEach(function (b) { b.classList.remove('is-active'); });
74
- btn.classList.add('is-active');
75
-
76
- var mode = btn.getAttribute('data-sort');
77
- allItems.sort(function (a, b) {
78
- if (mode === 'count') {
79
- var diff = (+b.getAttribute('data-count')) - (+a.getAttribute('data-count'));
80
- if (diff !== 0) return diff;
81
- }
82
- return a.getAttribute('data-name').localeCompare(b.getAttribute('data-name'), 'zh-CN');
83
- });
84
- allItems.forEach(function (el) { wrap.appendChild(el); });
85
- });
86
- });
87
- })();
88
- </script>
1
+ <section class="outer">
2
+ <% if (site.tags.length) { %>
3
+ <h1 class="page-type-title"><%= __('tags') %></h1>
4
+
5
+ <% var tagList = site.tags.sort('name'); %>
6
+
7
+ <div class="tag-cloud">
8
+ <div class="tag-cloud-header">
9
+ <span class="tag-cloud-stats">
10
+ 共 <strong><%= site.tags.length %></strong> 个标签,<strong><%= site.posts.length %></strong> 篇文章
11
+ </span>
12
+ <div class="tag-cloud-controls">
13
+ <div class="tag-cloud-search">
14
+ <input type="text"
15
+ class="tag-cloud-input"
16
+ placeholder="搜索标签…"
17
+ aria-label="搜索标签" />
18
+ </div>
19
+ <div class="tag-cloud-sort">
20
+ <button type="button" class="tag-sort-btn is-active" data-sort="name">名称</button>
21
+ <button type="button" class="tag-sort-btn" data-sort="count">热度</button>
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="tag-cloud-wrap">
27
+ <% tagList.each(function(tag) { %>
28
+ <a class="tag-cloud-item"
29
+ href="<%- url_for(tag.path) %>"
30
+ data-count="<%= tag.posts.length %>"
31
+ data-name="<%= tag.name.toLowerCase() %>">
32
+ <span class="tag-cloud-name"><%= tag.name %></span>
33
+ <span class="tag-cloud-count"><%= tag.posts.length %> 篇文章</span>
34
+ </a>
35
+ <% }); %>
36
+ </div>
37
+
38
+ <p class="tag-cloud-empty">没有匹配的标签</p>
39
+ </div>
40
+ <% } %>
41
+ </section>
42
+
43
+ <script>
44
+ (function () {
45
+ var wrap = document.querySelector('.tag-cloud-wrap');
46
+ if (!wrap) return;
47
+
48
+ var allItems = Array.prototype.slice.call(wrap.querySelectorAll('.tag-cloud-item'));
49
+ var input = document.querySelector('.tag-cloud-input');
50
+ var sortBtns = document.querySelectorAll('.tag-sort-btn');
51
+ var empty = document.querySelector('.tag-cloud-empty');
52
+
53
+ if (input) {
54
+ var timer;
55
+ input.addEventListener('input', function () {
56
+ clearTimeout(timer);
57
+ var self = this;
58
+ timer = setTimeout(function () {
59
+ var q = self.value.trim().toLowerCase();
60
+ var visible = 0;
61
+ allItems.forEach(function (el) {
62
+ var match = !q || el.getAttribute('data-name').indexOf(q) !== -1;
63
+ el.style.display = match ? '' : 'none';
64
+ if (match) visible++;
65
+ });
66
+ if (empty) empty.style.display = visible ? 'none' : '';
67
+ }, 120);
68
+ });
69
+ }
70
+
71
+ sortBtns.forEach(function (btn) {
72
+ btn.addEventListener('click', function () {
73
+ sortBtns.forEach(function (b) { b.classList.remove('is-active'); });
74
+ btn.classList.add('is-active');
75
+
76
+ var mode = btn.getAttribute('data-sort');
77
+ allItems.sort(function (a, b) {
78
+ if (mode === 'count') {
79
+ var diff = (+b.getAttribute('data-count')) - (+a.getAttribute('data-count'));
80
+ if (diff !== 0) return diff;
81
+ }
82
+ return a.getAttribute('data-name').localeCompare(b.getAttribute('data-name'), 'zh-CN');
83
+ });
84
+ allItems.forEach(function (el) { wrap.appendChild(el); });
85
+ });
86
+ });
87
+ })();
88
+ </script>
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "hexo-theme-ayeria",
3
- "version": "1.9.11",
4
- "description": "A clean and elegant theme for Hexo. Maintained fork of Shen-Yu/hexo-theme-ayer.",
5
- "scripts": {
6
- "dev": "rollup -c -w",
7
- "build": "rollup -c",
8
- "test": "stylint source-src/css/style.styl -c .stylintrc"
9
- },
10
- "source": "source-src/main.js",
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/KaleidScoper/hexo-theme-ayeria.git"
14
- },
15
- "keywords": [
16
- "hexo",
17
- "theme",
18
- "blog",
19
- "ayeria",
20
- "ayer"
21
- ],
22
- "author": "Kaleid_5coper <kaleided.scoper@gmail.com>",
23
- "contributors": [
24
- "Shen-Yu <shenyu@hotmail.com> (original author)"
25
- ],
26
- "license": "SATA",
27
- "bugs": {
28
- "url": "https://github.com/KaleidScoper/hexo-theme-ayeria/issues"
29
- },
30
- "homepage": "https://github.com/KaleidScoper/hexo-theme-ayeria",
31
- "devDependencies": {
32
- "autoprefixer": "^9.8.6",
33
- "rollup": "^2.50.2",
34
- "rollup-plugin-styles": "^3.14.1",
35
- "rollup-plugin-terser": "^7.0.2",
36
- "stylint": "^2.0.0",
37
- "stylus": "^0.64.0"
38
- }
39
- }
1
+ {
2
+ "name": "hexo-theme-ayeria",
3
+ "version": "1.9.13",
4
+ "description": "A clean and elegant theme for Hexo. Maintained fork of Shen-Yu/hexo-theme-ayer.",
5
+ "scripts": {
6
+ "dev": "rollup -c -w",
7
+ "build": "rollup -c",
8
+ "test": "stylint source-src/css/style.styl -c .stylintrc"
9
+ },
10
+ "source": "source-src/main.js",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/KaleidScoper/hexo-theme-ayeria.git"
14
+ },
15
+ "keywords": [
16
+ "hexo",
17
+ "theme",
18
+ "blog",
19
+ "ayeria",
20
+ "ayer"
21
+ ],
22
+ "author": "Kaleid_5coper <kaleided.scoper@gmail.com>",
23
+ "contributors": [
24
+ "Shen-Yu <shenyu@hotmail.com> (original author)"
25
+ ],
26
+ "license": "SATA",
27
+ "bugs": {
28
+ "url": "https://github.com/KaleidScoper/hexo-theme-ayeria/issues"
29
+ },
30
+ "homepage": "https://github.com/KaleidScoper/hexo-theme-ayeria",
31
+ "devDependencies": {
32
+ "autoprefixer": "^9.8.6",
33
+ "rollup": "^2.50.2",
34
+ "rollup-plugin-styles": "^3.14.1",
35
+ "rollup-plugin-terser": "^7.0.2",
36
+ "stylint": "^2.0.0",
37
+ "stylus": "^0.64.0"
38
+ }
39
+ }
@@ -1,6 +1,6 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- // 生成meta `generator`
5
- meta_generator: true
6
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ // 生成meta `generator`
5
+ meta_generator: true
6
+ };
@@ -1,11 +1,11 @@
1
- /* global hexo */
2
-
3
- "use strict";
4
-
5
- hexo.on("generateBefore", () => {
6
- require("./lib/merge-configs")(hexo);
7
- });
8
-
9
- hexo.on("generateAfter", () => {
10
- require("./lib/hello")(hexo);
11
- });
1
+ /* global hexo */
2
+
3
+ "use strict";
4
+
5
+ hexo.on("generateBefore", () => {
6
+ require("./lib/merge-configs")(hexo);
7
+ });
8
+
9
+ hexo.on("generateAfter", () => {
10
+ require("./lib/hello")(hexo);
11
+ });
@@ -1,38 +1,38 @@
1
- "use strict";
2
-
3
- module.exports = (hexo) => {
4
- const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
5
- const title = hexo.config.title || 'My Blog';
6
- const url = hexo.config.url || '';
7
-
8
- const pad = (str, width) => {
9
- const gap = width - str.length;
10
- if (gap <= 0) return str;
11
- const left = Math.floor(gap / 2);
12
- return ' '.repeat(left) + str + ' '.repeat(gap - left);
13
- };
14
-
15
- const W = 44;
16
- const line1 = pad(title, W);
17
- const line2 = isZh
18
- ? pad('Hexo 博客 · Ayeria 主题', W)
19
- : pad('Hexo Blog · Theme Ayeria', W);
20
- const line3 = pad(url, W);
21
-
22
- hexo.log.info(`
23
- ------------------------------------------------
24
- | |
25
- | __ ________ _____ |
26
- | /\\\\ \\ / / ____| __ \\ |
27
- | / \\\\ \\_/ /| |__ | |__) | |
28
- | / /\\ \\\\ / | __| | _ / |
29
- | / ____ \\| | | |____| | \\ \\ |
30
- | /_/ \\_\\_| |______|_| \\_\\ |
31
- | |
32
- |${line1}|
33
- |${line2}|
34
- |${line3}|
35
- | |
36
- ------------------------------------------------
37
- `);
38
- };
1
+ "use strict";
2
+
3
+ module.exports = (hexo) => {
4
+ const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
5
+ const title = hexo.config.title || 'My Blog';
6
+ const url = hexo.config.url || '';
7
+
8
+ const pad = (str, width) => {
9
+ const gap = width - str.length;
10
+ if (gap <= 0) return str;
11
+ const left = Math.floor(gap / 2);
12
+ return ' '.repeat(left) + str + ' '.repeat(gap - left);
13
+ };
14
+
15
+ const W = 44;
16
+ const line1 = pad(title, W);
17
+ const line2 = isZh
18
+ ? pad('Hexo 博客 · Ayeria 主题', W)
19
+ : pad('Hexo Blog · Theme Ayeria', W);
20
+ const line3 = pad(url, W);
21
+
22
+ hexo.log.info(`
23
+ ------------------------------------------------
24
+ | |
25
+ | __ ________ _____ |
26
+ | /\\\\ \\ / / ____| __ \\ |
27
+ | / \\\\ \\_/ /| |__ | |__) | |
28
+ | / /\\ \\\\ / | __| | _ / |
29
+ | / ____ \\| | | |____| | \\ \\ |
30
+ | /_/ \\_\\_| |______|_| \\_\\ |
31
+ | |
32
+ |${line1}|
33
+ |${line2}|
34
+ |${line3}|
35
+ | |
36
+ ------------------------------------------------
37
+ `);
38
+ };
@@ -1,28 +1,28 @@
1
- "use strict";
2
-
3
- const objUtil = require("../../utils/object");
4
- const { isNotEmptyObject } = require("../../utils/object");
5
-
6
- module.exports = (hexo) => {
7
- const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
8
-
9
- if (isNotEmptyObject(hexo.config.theme_config)) {
10
- hexo.theme.config = objUtil.merge(
11
- {},
12
- hexo.theme.config,
13
- hexo.config.theme_config
14
- );
15
- if (isZh) {
16
- hexo.log.info("[Ayeria] 读取 _config.yml 中 theme_config 配置项覆盖配置");
17
- } else {
18
- hexo.log.info(
19
- "[Ayeria] Merge theme config from theme_config in _config.yml"
20
- );
21
- }
22
- }
23
-
24
- hexo.log.debug(
25
- "[Ayeria] Output theme config:\n",
26
- JSON.stringify(hexo.theme.config, undefined, 2)
27
- );
28
- };
1
+ "use strict";
2
+
3
+ const objUtil = require("../../utils/object");
4
+ const { isNotEmptyObject } = require("../../utils/object");
5
+
6
+ module.exports = (hexo) => {
7
+ const isZh = hexo.theme.i18n.languages[0].search(/zh-CN/i) !== -1;
8
+
9
+ if (isNotEmptyObject(hexo.config.theme_config)) {
10
+ hexo.theme.config = objUtil.merge(
11
+ {},
12
+ hexo.theme.config,
13
+ hexo.config.theme_config
14
+ );
15
+ if (isZh) {
16
+ hexo.log.info("[Ayeria] 读取 _config.yml 中 theme_config 配置项覆盖配置");
17
+ } else {
18
+ hexo.log.info(
19
+ "[Ayeria] Merge theme config from theme_config in _config.yml"
20
+ );
21
+ }
22
+ }
23
+
24
+ hexo.log.debug(
25
+ "[Ayeria] Output theme config:\n",
26
+ JSON.stringify(hexo.theme.config, undefined, 2)
27
+ );
28
+ };
@@ -1,13 +1,13 @@
1
- 'use strict';
2
-
3
- const metaGeneratorPath = './meta_generator';
4
-
5
- module.exports = hexo => {
6
- /* const {
7
- filter
8
- } = hexo.extend; */
9
- // filter.register('after_render:html', require('./meta_generator'));
10
- };
11
-
12
- // 保持过滤器最先执行
13
- hexo.extend.filter.register('after_render:html', require(metaGeneratorPath), 1);
1
+ 'use strict';
2
+
3
+ const metaGeneratorPath = './meta_generator';
4
+
5
+ module.exports = hexo => {
6
+ /* const {
7
+ filter
8
+ } = hexo.extend; */
9
+ // filter.register('after_render:html', require('./meta_generator'));
10
+ };
11
+
12
+ // 保持过滤器最先执行
13
+ hexo.extend.filter.register('after_render:html', require(metaGeneratorPath), 1);
@@ -1,17 +1,17 @@
1
- 'use strict';
2
-
3
- const defaultConfig = require('../default_config');
4
-
5
- function hexoMetaGeneratorInject(data) {
6
- const config = defaultConfig;
7
- if (!config.meta_generator || !data ||
8
- data.match(/<meta\s+name=['|"]?generator['|"]?/i)) {
9
- return;
10
- }
11
-
12
- const hexoGeneratorTag = `\n <meta name="generator" content="hexo-theme-ayeria">`;
13
-
14
- return data.replace('</title>', '</title>' + hexoGeneratorTag);
15
- }
16
-
17
- module.exports = hexoMetaGeneratorInject;
1
+ 'use strict';
2
+
3
+ const defaultConfig = require('../default_config');
4
+
5
+ function hexoMetaGeneratorInject(data) {
6
+ const config = defaultConfig;
7
+ if (!config.meta_generator || !data ||
8
+ data.match(/<meta\s+name=['|"]?generator['|"]?/i)) {
9
+ return;
10
+ }
11
+
12
+ const hexoGeneratorTag = `\n <meta name="generator" content="hexo-theme-ayeria">`;
13
+
14
+ return data.replace('</title>', '</title>' + hexoGeneratorTag);
15
+ }
16
+
17
+ module.exports = hexoMetaGeneratorInject;
@@ -1,9 +1,9 @@
1
- /* global hexo */
2
-
3
- 'use strict';
4
-
5
- /** 自定义链接生成 */
6
- hexo.extend.helper.register('ayeria_plus_vendors', function (url) {
7
- if (url.startsWith('//')) return url;
8
- return this.url_for(`${url}`);
9
- });
1
+ /* global hexo */
2
+
3
+ 'use strict';
4
+
5
+ /** 自定义链接生成 */
6
+ hexo.extend.helper.register('ayeria_plus_vendors', function (url) {
7
+ if (url.startsWith('//')) return url;
8
+ return this.url_for(`${url}`);
9
+ });