Skip to content

Commit

Permalink
Merge pull request #460 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Dec 27, 2024
2 parents 12a118e + 5b086f4 commit 5086a42
Show file tree
Hide file tree
Showing 19 changed files with 194 additions and 75 deletions.
49 changes: 31 additions & 18 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ footer:
author: false # img url / false
left:
# Github: https://github.com/everfu || fab fa-github # 名称: 链接 || 图标
# Mail: mailto:[email protected] || fab fa-envelope
# Mail: mailto:[email protected] || far fa-envelope
right:
# Bilibili: https://space.bilibili.com/1329819902 || fab fa-bilibili
# Douyin: https://v.douyin.com/iJsLc8jt/ || fab fa-tiktok
Expand Down Expand Up @@ -998,21 +998,34 @@ CDN:
custom_format: https://fastly.jsdelivr.net/npm/${name}@${version}/${min_file} # 自定义格式
# 直接覆盖默认 CDN 链接(优先级最高)
options:
# algolia_search:
# instantsearch:
# pjax:
# twikoo:
# waline_js:
# waline_css:
# katex:
# katex_copytex:
# lazyload:
# aplayer_css:
# aplayer_js:
# meting_js:
# pace_js:
# swiper_css:
# swiper_js:
# busuanzi_js:
# snackbar_js:
# algolia_search
# aplayer_css
# aplayer_js
# artalk_css
# artalk_js
# blueimp_md5
# busuanzi_js
# chart_js
# color_thief
# fancyapps_css
# fancyapps_ui
# fontawesome
# instantsearch
# katex
# katex_copytex
# lazyload
# medium_zoom
# mermaid_js
# meting_js
# pace_js
# pjax
# qrcode
# snackbar
# swiper_css
# swiper_js
# twikoo
# typeit_js
# valine
# waline_css
# waline_js
# --------------------------- end ---------------------------
1 change: 0 additions & 1 deletion layout/includes/head/opengraph.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ if theme.OpenGraph.enable
}
-
!= open_graph(ogOption)
meta(name="description" content=page_description())
else
meta(name="description" content=page_description())
2 changes: 1 addition & 1 deletion layout/includes/inject/body.pug
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ div
if is_home() && theme.carousel && site.posts.data.filter(item => item.recommend === true).slice(0, 6) || false
script.
carousel_swiper()
if theme.busuanzi && (theme.aside.siteinfo.uv || theme.aside.siteinfo.pv)
if theme.busuanzi && (theme.aside.siteinfo.uv || theme.aside.siteinfo.pv || is_post() && theme.post.meta.pv)
script(defer pjax src=url_for(theme.cdn.busuanzi_js))


Expand Down
6 changes: 6 additions & 0 deletions layout/includes/sidebar.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ div#sidebar(style="zoom: 1;")
a(href=url_for('/tags/'))
.headline=_p('page.tag')
.length-num=site.tags.find({parent: {$exists: false}}).length
if theme.recent_comments.enable
.data-item.is-center
.data-item-link
a(href=url_for(theme.recent_comments.page))
.headline=_p('comment.title')
include ./widgets/sidebar/comment
span.sidebar-menu-item-title= __('sidebar.function')
div.sidebar-menu-item
span.darkmode_switchbutton.menu-child(onclick="sco.switchDarkMode()")
Expand Down
24 changes: 13 additions & 11 deletions layout/includes/widgets/page/about/skillsinfo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ if skills || careers
.tags-group-all
.tags-group-wrapper
- var pair = []
each tag, index in skills.tags
- pair.push(tag)
if pair.length === 2 || index === skills.tags.length - 1
.tags-group-icon-pair
each item in pair
.tags-group-icon(style=`background:${item.color}`)
if item.img
img(src=item.img, title=item.title)
else if item.icon
i(class=item.icon, title=item.title, style=`color: ${item.icon_color ? item.icon_color : ''}`)
- pair = []
- let times = skills.tags.length? Math.ceil(20/skills.tags.length):0
- for (let i = 0; i < 4 * times; i++)
each tag, index in skills.tags
- pair.push(tag)
if pair.length === 2
.tags-group-icon-pair
each item in pair
.tags-group-icon(style=`background:${item.color}`)
if item.img
img(src=item.img, title=item.title)
else if item.icon
i(class=item.icon, title=item.title, style=`color: ${item.icon_color ? item.icon_color : ''}`)
- pair = []
.skills-list
each tag in skills.tags
.skill-info
Expand Down
52 changes: 30 additions & 22 deletions layout/includes/widgets/page/links/banner.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.banners-title
.banners-title-small= page.title
.banners-title-big= page.desc
.banners-title-small= page.desc
.banners-title-big= page.title

.banner-button-group
if theme.footer.randomlink
Expand All @@ -12,23 +12,31 @@
i.solitude.fa-solid.fa-circle-chevron-right
span.solitude.banner-button-text=_p('link.banner.toComment')

.tags-group-all.nowrapMove
.tags-group-wrapper
- const data = site.data.links.links
- for (let i = 0; i < 2; i++)
- var links = []
each x in data
each y in x.link_list
- links.push(y)
- var pairs = []
each link, index in links
if (index % 2 === 0)
- pairs.push([link])
else
- pairs[pairs.length - 1].push(link)
each pair in pairs
.tags-group-icon-pair
each y in pair
a.tags-group-icon(href=url_for(y.link), title=y.name)
img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
span.tags-group-title=y.name
- if (site.data.links.swiper !== false)
.tags-group-all.nowrapMove
.tags-group-wrapper
- const data = site.data.links.links
- var links = []
each x in data
each y in x.link_list
- links.push(y)
- if (links.length)
- let originalLinks = links
- while (links.length<20)
- links = links.concat(originalLinks)
each i in [1,2]
- links = links.concat(links)
- var pairs = []
each link, index in links
if (index % 2 === 0)
- pairs.push([link])
else
- pairs[pairs.length - 1].push(link)
each pair in pairs
.tags-group-icon-pair
each y in pair
a.tags-group-icon(href=url_for(y.link), title=y.name)
img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
span.tags-group-title=y.name
- else
.tags-group-all(style="height:calc(3rem + 72px);")
2 changes: 1 addition & 1 deletion layout/includes/widgets/post/postInfo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
span.post-meta-position(title=_p('post.ip') + page.locate)
i.post-meta-icon.solitude.fas.fa-location-dot
span= page.locate
if theme.post.meta.pv
if theme.post.meta.pv && (theme.comment.use && theme.comment.pv || theme.busuanzi)
a.post-meta-pv(href=url_for(page.path), title=_p('post.pv'))
i.post-meta-icon.solitude.fa-solid.fa-fire-flame-curved
if theme.comment.use && theme.comment.pv
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/widgets/rightside/hide.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if theme.rightside.hide.mode
button.mode(type='button' title=_p('rightside.hide.mode') onclick='sco.switchDarkMode()')
i.fas.fa-circle-half-stroke
if theme.rightside.hide.aside
if theme.rightside.hide.aside && theme.console.enable
button.aside.pc(type='button' title=_p('rightside.hide.aside') onclick='sco.switchHideAside()')
i.fas.fa-arrows-alt-h
if theme.keyboard.enable
Expand Down
13 changes: 13 additions & 0 deletions layout/includes/widgets/sidebar/artalk.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.length-num#artalk_allcount
i.solitude.fa-solid.fa-spinner.fa-spin

- const { server, site } = theme.artalk

script(pjax).
(async () => {
const searchParams = new URLSearchParams({'site_name': "!{site}", 'limit': '-1'})
await fetch(`!{server}/api/v2/stats/latest_comments?${searchParams}`, {method: 'GET'}).then(async res => res.json())
.then(async data => {
document.querySelector('#artalk_allcount').innerHTML = data.length
})
})()
13 changes: 13 additions & 0 deletions layout/includes/widgets/sidebar/comment.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- const {use} = theme.comment

case use[0]
when 'Twikoo'
!=partial('includes/widgets/sidebar/twikoo', {}, {cache: true})
when 'Waline'
!=partial('includes/widgets/sidebar/waline', {}, {cache: true})
when 'Valine'
!=partial('includes/widgets/sidebar/valine', {}, {cache: true})
when 'Artalk'
!=partial('includes/widgets/sidebar/artalk', {}, {cache: true})
when 'Giscus'
!=partial('includes/widgets/sidebar/giscus', {}, {cache: true})
19 changes: 19 additions & 0 deletions layout/includes/widgets/sidebar/twikoo.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.length-num#twikoo_allcount
i.solitude.fa-solid.fa-spinner.fa-spin

- const {envId} = theme.twikoo

script(pjax).
(async () => {
await fetch('!{envId}', {
method: "POST",
body: JSON.stringify({
"event": "GET_RECENT_COMMENTS",
"includeReply": true,
"pageSize": -1
}),
headers: {'Content-Type': 'application/json'}
}).then(res => res.json()).then(async ({data}) => {
document.querySelector('#twikoo_allcount').innerHTML = data.length
})
})()
18 changes: 18 additions & 0 deletions layout/includes/widgets/sidebar/valine.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.length-num#valine_allcount
i.solitude.fa-solid.fa-spinner.fa-spin

- const { appId, appKey, serverURLs } = theme.valine

script(pjax).
(async () => {
await fetch('!{serverURLs}/1.1/classes/Comment?limit=-1&order=-createdAt', {
method: "GET",
headers: {
"X-LC-Id": '!{appId}',
"X-LC-Key": '!{appKey}',
"Content-Type": "application/json"
}
}).then(async res => res.json()).then(async results => {
document.querySelector('#valine_allcount').innerHTML = results.length
})
})()
10 changes: 10 additions & 0 deletions layout/includes/widgets/sidebar/waline.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.length-num#waline_allcount
i.solitude.fa-solid.fa-spinner.fa-spin

script(pjax).
(async () => {
await fetch('!{theme.waline.envId}/api/comment?type=recent&count=-1', {method: 'GET'}).then(async res => res.json())
.then(async data => {
document.querySelector('#waline_allcount').innerHTML = data.length
})
})()
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-solitude",
"version": "2.1.14",
"version": "2.1.15",
"description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
"main": "package.json",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugins.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
algolia_search:
name: algoliasearch
file: dist/algoliasearch.umd.js
version: 5.17.1
version: 5.18.0
instantsearch:
name: instantsearch.js
file: dist/instantsearch.production.min.js
Expand Down
6 changes: 6 additions & 0 deletions source/css/_global/animation.styl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@
to
transform translateX(-50%)

@keyframes rowleft-quarter
from
transform translateX(-25%)
to
transform translateX(-75%)

@keyframes gradient
0%
background-position 0 50%
Expand Down
2 changes: 1 addition & 1 deletion source/css/_page/_about/skills.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
margin-top 40px
display flex
flex-wrap nowrap
animation rowleft 60s linear infinite
animation rowleft-quarter 30s linear infinite

.skills-style-group
position relative
Expand Down
2 changes: 1 addition & 1 deletion source/css/_page/other.styl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ div#banners

.tags-group-wrapper
margin-top: 7rem
animation: rowleft 120s linear infinite
animation: rowleft-quarter 30s linear infinite
display flex

+maxWidth768()
Expand Down
Loading

0 comments on commit 5086a42

Please sign in to comment.