hexo-theme-solitude 1.10.4 → 1.10.6

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 (38) hide show
  1. package/README.md +1 -1
  2. package/_config.yml +11 -8
  3. package/layout/includes/inject/body.pug +3 -4
  4. package/layout/includes/inject/head.pug +1 -1
  5. package/layout/includes/widgets/aside/asideInfoCard.pug +31 -1
  6. package/layout/includes/widgets/home/hometop.pug +0 -1
  7. package/layout/includes/widgets/home/topGroup.pug +9 -8
  8. package/layout/includes/widgets/third-party/news-comment/artalk.pug +1 -1
  9. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +1 -1
  10. package/layout/includes/widgets/third-party/news-comment/waline.pug +1 -1
  11. package/package.json +1 -1
  12. package/scripts/event/merge_config.js +1 -0
  13. package/source/css/_global/index.styl +29 -29
  14. package/source/css/_layout/article-container.styl +1 -1
  15. package/source/css/_layout/aside.styl +158 -13
  16. package/source/css/_layout/console.styl +7 -13
  17. package/source/css/_layout/header.styl +1 -28
  18. package/source/css/_layout/rightmenu.styl +1 -1
  19. package/source/css/_layout/sidebar.styl +1 -1
  20. package/source/css/_page/_about/about.styl +2 -1
  21. package/source/css/_page/_about/buff.styl +1 -1
  22. package/source/css/_page/_about/contentinfo.styl +2 -2
  23. package/source/css/_page/_about/maxim.styl +1 -1
  24. package/source/css/_page/_about/myphoto.styl +1 -1
  25. package/source/css/_page/_about/oneself.styl +2 -2
  26. package/source/css/_page/_about/personalities.styl +1 -1
  27. package/source/css/_page/_about/skills.styl +1 -1
  28. package/source/css/_page/_about/statistic.styl +1 -1
  29. package/source/css/_page/_home/home-top.styl +17 -96
  30. package/source/css/_page/_home/home.styl +9 -2
  31. package/source/css/_page/links.styl +0 -3
  32. package/source/css/_page/other.styl +127 -115
  33. package/source/css/_page/says.styl +5 -11
  34. package/source/css/_tags/gallery.styl +5 -3
  35. package/source/js/main.js +2 -22
  36. package/source/js/search/algolia.js +11 -0
  37. package/source/js/search/local.js +11 -0
  38. package/layout/includes/widgets/home/categoryGroup.pug +0 -12
package/source/js/main.js CHANGED
@@ -163,7 +163,7 @@ let is_rm = typeof rm !== 'undefined'
163
163
  /**
164
164
  * sco
165
165
  * @description solitude 主题的一些方法
166
- * @type {{showConsole: (function(): boolean), setTimeState: sco.setTimeState, toTop: (function(): void), changeTimeFormat(*): void, hideCookie: sco.hideCookie, owoBig(*): void, switchDarkMode: sco.switchDarkMode, openAllTags: sco.openAllTags, switchHideAside: sco.switchHideAside, addRuntime: sco.addRuntime, refreshWaterFall: sco.refreshWaterFall, categoriesBarActive: sco.categoriesBarActive, addNavBackgroundInit: sco.addNavBackgroundInit, toPage: sco.toPage, changeSayHelloText: sco.changeSayHelloText, initConsoleState: (function(): void), switchComments(): void, switchKeyboard: sco.switchKeyboard, initAdjust: sco.initAdjust, listenToPageInputPress: sco.listenToPageInputPress, scrollTo: sco.scrollTo, musicToggle: sco.musicToggle, toTalk: sco.toTalk, switchCommentBarrage: sco.switchCommentBarrage, hideTodayCard: (function(): void), scrollCategoryBarToRight: sco.scrollCategoryBarToRight, scrollToComment: sco.scrollToComment, initbbtalk: sco.initbbtalk, tagPageActive: sco.tagPageActive, hideConsole: (function(): void), addPhotoFigcaption: sco.addPhotoFigcaption}}
166
+ * @type {{showConsole: (function(): boolean), setTimeState: sco.setTimeState, toTop: (function(): void), changeTimeFormat(*): void, hideCookie: sco.hideCookie, owoBig(*): void, switchDarkMode: sco.switchDarkMode, openAllTags: sco.openAllTags, switchHideAside: sco.switchHideAside, addRuntime: sco.addRuntime, refreshWaterFall: sco.refreshWaterFall, categoriesBarActive: sco.categoriesBarActive, addNavBackgroundInit: sco.addNavBackgroundInit, toPage: sco.toPage, changeSayHelloText: sco.changeSayHelloText, initConsoleState: (function(): void), switchComments(): void, switchKeyboard: sco.switchKeyboard, listenToPageInputPress: sco.listenToPageInputPress, scrollTo: sco.scrollTo, musicToggle: sco.musicToggle, toTalk: sco.toTalk, switchCommentBarrage: sco.switchCommentBarrage, hideTodayCard: (function(): void), scrollCategoryBarToRight: sco.scrollCategoryBarToRight, scrollToComment: sco.scrollToComment, initbbtalk: sco.initbbtalk, tagPageActive: sco.tagPageActive, hideConsole: (function(): void), addPhotoFigcaption: sco.addPhotoFigcaption}}
167
167
  */
168
168
  let sco = {
169
169
  /**
@@ -507,26 +507,6 @@ let sco = {
507
507
  const scrollTop = document.documentElement.scrollTop;
508
508
  (scrollTop !== 0) && document.getElementById("page-header").classList.add("nav-fixed", "nav-visible");
509
509
  },
510
- /**
511
- * initAdjust
512
- * @description 初始化调整
513
- */
514
- initAdjust: function () {
515
- const $blogName = document.getElementById('site-name');
516
- const $menusEle = document.querySelector('#menus .menus_items');
517
- const $searchEle = document.querySelector('#search-button');
518
- const $nav = document.getElementById('nav');
519
- const blogNameWidth = $blogName && $blogName.offsetWidth;
520
- const menusWidth = $menusEle && $menusEle.offsetWidth;
521
- const searchWidth = $searchEle && $searchEle.offsetWidth;
522
- const shouldHideMenu = window.innerWidth < 768 || blogNameWidth + menusWidth + searchWidth > $nav?.offsetWidth - 120;
523
- if (shouldHideMenu) {
524
- $nav?.classList.add('hide-menu');
525
- } else {
526
- $nav?.classList.remove('hide-menu');
527
- }
528
- $nav?.classList.add('show');
529
- },
530
510
  /**
531
511
  * toPage
532
512
  * @description 跳转到指定页
@@ -822,7 +802,7 @@ window.refreshFn = () => {
822
802
  }
823
803
  // 页面加载完成后执行
824
804
  document.addEventListener('DOMContentLoaded', () => {
825
- [sco.initAdjust, addCopyright, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
805
+ [addCopyright, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
826
806
  });
827
807
  // 一些快捷键绑定
828
808
  window.onkeydown = e => {
@@ -30,6 +30,17 @@ window.addEventListener("load", () => {
30
30
  }
31
31
  };
32
32
 
33
+ const addEventCtrlK = () => {
34
+ document.addEventListener("keydown", function (event) {
35
+ if (event.ctrlKey && event.key === "k") {
36
+ event.preventDefault();
37
+ openSearch();
38
+ }
39
+ });
40
+ }
41
+
42
+ addEventCtrlK()
43
+
33
44
  const searchClickFn = () => {
34
45
  utils.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
35
46
 
@@ -37,6 +37,17 @@ window.addEventListener("load", () => {
37
37
 
38
38
  addEventTagList()
39
39
 
40
+ const addEventCtrlK = () => {
41
+ document.addEventListener("keydown", function (event) {
42
+ if (event.ctrlKey && event.key === "k") {
43
+ event.preventDefault();
44
+ openSearch();
45
+ }
46
+ });
47
+ }
48
+
49
+ addEventCtrlK()
50
+
40
51
  const searchFnOnce = () => {
41
52
  $searchMask.addEventListener("click", closeSearch);
42
53
  utils.addEventListenerPjax(document.querySelector("#local-search .search-close-button"), "click", closeSearch);
@@ -1,12 +0,0 @@
1
- - gg = theme.hometop.group
2
- - group = gg ? (Object.entries(gg)).slice(0, 2) : null
3
-
4
- if group
5
- .categoryGroup
6
- each item in group
7
- - var array = item[1].split('||')
8
- .categoryItem
9
- a.categoryButton(href=url_for(trim(array[0])) style="background-image:" + array[2] + ";")
10
- span.categoryButtonText= item[0]
11
- if array[1]
12
- i.solitude(class=trim(array[1]))