hexo-theme-solitude 2.1.5 → 2.1.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.
package/_config.yml CHANGED
@@ -657,6 +657,9 @@ loading:
657
657
  # Full screen loading
658
658
  # 全屏加载
659
659
  fullpage: false
660
+ # Loading icon, default is siteicon
661
+ # 加载图标,不写默认siteicon
662
+ favicon: /img/favicon.png
660
663
  # Pace loading
661
664
  # Pace 加载
662
665
  pace: true
@@ -1,10 +1,12 @@
1
+ - var showToc = !!page.toc && (toc(page.content) !== '' || page.encrypt === true);
2
+
1
3
  script#config-diff.
2
4
  var PAGE_CONFIG = {
3
5
  is_post: !{is_post()},
4
6
  is_page: !{!is_post() && !is_home()},
5
7
  is_home: !{is_home()},
6
8
  page: '!{page.type}',
7
- toc: !{!!page.toc},
9
+ toc: !{showToc},
8
10
  comment: !{!!page.comment},
9
11
  ai_text: !{is_post && page.ai_text ? "'"+ page.ai_text+"'" : false},
10
12
  color: !{page.color ? "'"+ page.color+"'" : false},
@@ -1,6 +1,6 @@
1
1
  div(id="loading-box" onclick="preloader.endLoading();" style="zoom:1")
2
2
  div.loading-bg
3
- img.loading-img.nolazyload(src=url_for(theme.site.icon), alt="loading image")
3
+ img.loading-img.nolazyload(src=url_for(theme.loading.favicon || theme.site.icon), alt="loading image")
4
4
 
5
5
  script.
6
6
  const preloader = {
@@ -12,7 +12,7 @@
12
12
  each item in noSticky
13
13
  include ./asideSwitch.pug
14
14
  .sticky_layout
15
- if page.toc
15
+ if showToc
16
16
  include ./asideToc.pug
17
17
  each item in Sticky
18
18
  include ./asideSwitch.pug
@@ -16,16 +16,19 @@
16
16
  .tags-group-wrapper
17
17
  - const data = site.data.links.links
18
18
  - for (let i = 0; i < 2; i++)
19
+ - var links = []
19
20
  each x in data
20
- - var pairs = []
21
- each y, index in x.link_list
22
- if (index % 2 === 0)
23
- - pairs.push([y])
24
- else
25
- - pairs[pairs.length - 1].push(y)
26
- each pair in pairs
27
- .tags-group-icon-pair
28
- each y in pair
29
- a.tags-group-icon(href=url_for(y.link), title=y.name)
30
- img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
31
- span.tags-group-title=y.name
21
+ each y in x.link_list
22
+ - links.push(y)
23
+ - var pairs = []
24
+ each link, index in links
25
+ if (index % 2 === 0)
26
+ - pairs.push([link])
27
+ else
28
+ - pairs[pairs.length - 1].push(link)
29
+ each pair in pairs
30
+ .tags-group-icon-pair
31
+ each y in pair
32
+ a.tags-group-icon(href=url_for(y.link), title=y.name)
33
+ img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
34
+ span.tags-group-title=y.name
@@ -2,7 +2,7 @@
2
2
  if theme.rightside.hide.enable
3
3
  button.config(type='button' title=_p('rightside.show.gear') onclick='document.querySelector(".rs_hide").classList.toggle("show")')
4
4
  i.fas.fa-gear.fa-spin
5
- if page.toc
5
+ if showToc
6
6
  button.mobile.toc(type='button' title=_p('rightside.show.toc') onclick="document.querySelector('#card-toc').classList.toggle('open')")
7
7
  i.fas.fa-list
8
8
  if page.comment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -142,6 +142,6 @@ hexo.extend.filter.register('before_generate', () => {
142
142
  themeConfig.cdn = Object.assign(
143
143
  createCDNLink(internalSrc, CDN.internal, 'internal'),
144
144
  createCDNLink(thirdPartySrc, CDN.third_party),
145
- deleteNullValue(CDN.option)
145
+ deleteNullValue(CDN.options)
146
146
  )
147
147
  })
@@ -15,4 +15,4 @@ const article = ([path]) => {
15
15
  return `<div class="recent-post-item" onclick="pjax.loadUrl('${'/' + post.path}')">${postCover + recentPostInfo}</div>`;
16
16
  }
17
17
 
18
- hexo.extend.tag.register('article', article)
18
+ hexo.extend.tag.register('article', article)
@@ -78,6 +78,15 @@ figure
78
78
  font-size 1.15em
79
79
  user-select none
80
80
 
81
+ .caption
82
+ position absolute
83
+ right 2.7rem
84
+ font-size 0.85em
85
+ color var(--efu-secondtext)
86
+
87
+ +maxWidth768()
88
+ display none
89
+
81
90
  .code-expand-btn
82
91
  background var(--efu-hltools-bg)
83
92
  transition .3s
@@ -1,4 +1,4 @@
1
- #article-container
1
+ .post-content
2
2
  overflow-wrap break-word
3
3
  +maxWidth768()
4
4
  overflow hidden
package/source/js/main.js CHANGED
@@ -524,9 +524,15 @@ const addHighlight = () => {
524
524
  const createEle = (lang, item, service) => {
525
525
  const fragment = document.createDocumentFragment()
526
526
  if ($isShowTool) {
527
+ const captionItem = item.querySelector('figcaption')
528
+ let caption = ''
529
+ if (captionItem) {
530
+ caption = `<div class="caption">${captionItem.innerHTML}</div>`
531
+ item.removeChild(captionItem)
532
+ }
527
533
  const hlTools = document.createElement('div')
528
534
  hlTools.className = `highlight-tools ${expandClass}`
529
- hlTools.innerHTML = expandEle + lang + copyEle
535
+ hlTools.innerHTML = expandEle + lang + caption + copyEle
530
536
  utils.addEventListenerPjax(hlTools, 'click', ToolsFn)
531
537
  fragment.appendChild(hlTools)
532
538
  }