Skip to content

Commit

Permalink
Merge pull request #328 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Jul 24, 2024
2 parents 6897385 + 93876a1 commit bdd6e82
Show file tree
Hide file tree
Showing 29 changed files with 334 additions and 240 deletions.
380 changes: 195 additions & 185 deletions _config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ page:
404: Page not found

home:
home: Home
home: Recommend
sticky: Sticky
new: New
read: Unread
Expand Down
2 changes: 1 addition & 1 deletion languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ page:
404: Page not found

home:
home: Home
home: Recommend
sticky: Sticky
new: New
read: Unread
Expand Down
2 changes: 1 addition & 1 deletion languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ nav:
console: 中控台

home:
home: 首页
home: 推荐
sticky: 置顶
new: 最新
read: 未读
Expand Down
2 changes: 1 addition & 1 deletion languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ nav:
console: 中控台

home:
home: 首頁
home: 推薦
sticky: 置頂
new: 最新
read: 未讀
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/console.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- const { recentComment, card } = theme.console
- const { cache } = recentComment
- const cache = recentComment.storage
- const limit = 6
- const { use } = theme.comment

Expand Down
1 change: 0 additions & 1 deletion layout/includes/layout.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- page.type = is_home() ? 'solitude' : page.type

doctype html
html(lang=config.language, data-theme="light")
head
Expand Down
4 changes: 2 additions & 2 deletions layout/includes/widgets/aside/asideNewestPost.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
a.thumbnail(href=url_for(post.path) title=post.title)
img(alt=post.title src=url_for(post.cover))
.content
a.title(href=url_for(post.path) title=post.title)= post.title
span.title(href=url_for(post.path) title=post.title)= post.title
if post.categories.data[0]
a.article-recent_post_categories(href=url_for(post.path))= post.categories.data[0].name
span.article-recent_post_categories(href=url_for(post.path))= post.categories.data[0].name
- index++
45 changes: 45 additions & 0 deletions layout/includes/widgets/home/hot/artalk.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- const { server, site } = theme.artalk

script.
function updatePostsBasedOnComments() {
const location = window.location
const posts = Array.from(document.querySelectorAll('.recent-post-item[onclick] .post_cover a')).map(item => item.href.replace(location, GLOBAL_CONFIG.root))

function get() {
fetch(`!{server}/api/v2/stats/page_comment?page_keys=${posts.join(',')}&site_name=!{site}`).then(res => res.json())
.then(item => {
item = item.data
posts.forEach(post => {
const comment = item[post]
if (comment > !{count}) {
const postElement = document.querySelector(`.recent-post-item[onclick*="${post}"]`);
if (postElement) {
const infoTopTips = postElement.querySelector(".recent-post-info-top-tips"),
originalSpan = infoTopTips ? infoTopTips.querySelector(".original") : null;
if (originalSpan) {
const hotTip = createHotTipElement();
infoTopTips.insertBefore(hotTip, originalSpan);
}
}
}
})
})
.catch(error => console.error("Error fetching comments:", error));
}

function createHotTipElement() {
const hotTip = document.createElement("span");
hotTip.classList.add("hot-tip");

const icon = document.createElement("i");
icon.classList.add("solitude", "st-fire-fill");
hotTip.appendChild(icon);

const commentCount = document.createTextNode("!{_p('hot-tip')}");
hotTip.appendChild(commentCount);

return hotTip;
}

get()
}
4 changes: 3 additions & 1 deletion layout/includes/widgets/home/hot/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
if use
case use[0]
when 'Twikoo'
include ./twikoo
include ./twikoo
when 'Artalk'
include ./artalk
7 changes: 7 additions & 0 deletions layout/includes/widgets/third-party/comments/artalk.pug
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ script.
})
const destroyArtalk = () => artalkItem.destroy()
utils.addGlobalFn('pjax', destroyArtalk, 'destroyArtalk')
document.addEventListener('pjax:complete', function () {
artalkItem.update({
pageKey: window.location.pathname,
pageTitle: document.title
});
artalkItem.reload();
});
}
const loadArtalk = async () => {
if (typeof Artalk === 'object') initArtalk()
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-solitude",
"version": "1.13.3",
"version": "1.13.4",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"main": "package.json",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"url": "https://github.com/everfu/hexo-theme-solitude/issues",
"email": "[email protected]"
},
"homepage": "https://www.efu.me/",
"homepage": "https://everfu.github.io/Solitude/",
"author": "Hexo-Theme-Solitude<[email protected]>",
"license": "MIT"
}
14 changes: 7 additions & 7 deletions plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ algolia_search:
instantsearch:
name: instantsearch.js
file: dist/instantsearch.production.min.js
version: 4.73.0
version: 4.73.2
pjax:
name: pjax
file: pjax.min.js
version: 0.2.8
twikoo:
name: twikoo
file: dist/twikoo.all.min.js
version: 1.6.36
version: 1.6.38
waline_js:
name: '@waline/client'
file: dist/waline.js
other_name: waline
version: 3.2.7
version: 3.3.0
waline_css:
name: '@waline/client'
file: dist/waline.css
version: 3.2.7
version: 3.3.0
other_name: waline
valine:
name: valine
file: dist/Valine.min.js
version: 1.5.1
version: 1.5.2
artalk_css:
name: artalk
file: dist/Artalk.css
Expand Down Expand Up @@ -70,12 +70,12 @@ pace_js:
swiper_css:
name: swiper
file: swiper-bundle.min.css
version: 11.0.5
version: 11.1.7
other_name: Swiper
swiper_js:
name: swiper
file: swiper-bundle.min.js
version: 11.0.5
version: 11.1.7
other_name: Swiper
busuanzi_js:
name: busuanzi
Expand Down
7 changes: 3 additions & 4 deletions source/css/_comments/comment.styl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
font-size .6rem
color var(--efu-secondtext)
border-radius 8px

if hexo-config('comment.use')[1]
if index(hexo-config('comment.use'), ',') || hexo-config('comment.use')[1]
&.move
if hexo-config('comment.count')
.comment-head
Expand All @@ -102,7 +101,7 @@
margin .5rem 0
position relative

if hexo-config('comment.use')[1]
if index(hexo-config('comment.use'), ',') || ',' in hexo-config('comment.use')
.count span:last-child
display none

Expand Down Expand Up @@ -138,7 +137,7 @@
content ''
transition .4s

if hexo-config('comment.use')[1]
if ',' in hexo-config('comment.use') || index(hexo-config('comment.use'), ',')
.comment-wrap
> div:last-child
display none
Expand Down
3 changes: 2 additions & 1 deletion source/css/_global/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ if hexo-config('background.enable')
height 100%
background-image url(hexo-config('background.light'))
background-size cover
background-position center
pointer-events none
background-repeat no-repeat

[data-theme=dark] &
background-image url(hexo-config('background.dark'))
background-image url(hexo-config('background.dark'))
17 changes: 13 additions & 4 deletions source/css/_layout/article-container.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

.post &
padding 1rem 2rem
+maxWidth768()
padding .5rem

iframe
border-radius 12px
Expand Down Expand Up @@ -36,9 +38,9 @@
overflow-x scroll

a.headerlink
float right
opacity .08
position relative
position absolute
right 0
padding 0
border none
border-radius 8px
Expand Down Expand Up @@ -181,10 +183,11 @@

&.post-content
h1, h2, h3, h4
padding-right 1rem
position relative
display flex
flex-wrap wrap
align-items center
justify-content space-between
flex-direction row-reverse
transition all .2s ease-out 0s

h1
Expand All @@ -200,6 +203,12 @@
h3, h4
font-size 1.1rem
line-height 1.3
hr
display flex
position relative
margin 0.5rem 0
border-width 0
border-top 1px dashed var(--efu-theme-op)

if hexo-config('mediumZoom')
.medium-zoom--opened .medium-zoom-overlay
Expand Down
7 changes: 4 additions & 3 deletions source/css/_layout/aside.styl
Original file line number Diff line number Diff line change
Expand Up @@ -962,14 +962,15 @@ if hexo-config('aside.card.style') == 2
flex-direction column

.title
display -webkit-box
-webkit-box-orient vertical
font-weight 700
padding 2px 0
margin-bottom 8px
color var(--efu-fontcolor)
margin 4px 0
font-size 95%
line-height 1.3
-webkit-line-clamp 2
overflow hidden
text-overflow ellipsis

.article-recent_post_categories
font-size 12px
Expand Down
13 changes: 9 additions & 4 deletions source/css/_layout/header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
align-items center
margin-right 1.5rem
overflow hidden
gap .5rem

+maxWidth768()
margin-right 12px
Expand All @@ -142,6 +141,11 @@
padding 0

.nav-button
margin-left .5rem

&#nav-totop
margin-right .5rem

a
height 35px
width 35px
Expand Down Expand Up @@ -270,7 +274,7 @@
transform scale(0)
margin-left 0
overflow hidden
transition .3s ease-in
transition .3s

#page-header #scroll-down .scroll-down-effects,
#page-header #site-subtitle, #page-header #site-title
Expand Down Expand Up @@ -686,7 +690,7 @@ if hexo-config('nav.group')
opacity 0
pointer-events none
backdrop-filter blur(20px)
-webkit-backdrop-filter blur(20px)
-webkit-backdrop-filter blur(20px)

+maxWidth768()
left 0
Expand Down Expand Up @@ -756,6 +760,7 @@ if hexo-config('nav.group')
#site-name
&:after
color var(--efu-card-bg)

.not-top-img
#nav
a
Expand Down Expand Up @@ -893,7 +898,7 @@ if hexo-config('nav.group')
overflow hidden
left 0

if hexo-config('nav.right.console')
if hexo-config('console.enable')
#nav-console
+maxWidth768()
display none
5 changes: 4 additions & 1 deletion source/css/_page/_about/author.styl
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,7 @@
height 20px

img
border-radius 200px
border-radius 200px
width 100%
height 100%
object-fit cover
2 changes: 1 addition & 1 deletion source/css/_page/_about/buff.styl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
animation gradient 15s ease infinite
min-height 200px
height fit-content
width 59.5%
width calc(60% - (.5rem / 2))

.card-content
display flex
Expand Down
Loading

0 comments on commit bdd6e82

Please sign in to comment.