Skip to content

Commit

Permalink
Merge pull request #427 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Dec 8, 2024
2 parents 7e7cf56 + 1b02595 commit 47432a5
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 39 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ hometop:
group:
# 热门: /tags/Fire/ || fas fa-fire || linear-gradient(to right,#f65,#ffbf37)
recommendList:
enable: true
sup: 置顶
title: Solitude 官方文档
url: https://solitude.js.org/
Expand Down
5 changes: 3 additions & 2 deletions layout/includes/widgets/aside/asideNewestPost.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
.aside-list
each post in site.posts.data.sort((a, b) => b.date < a.date ? -1 : 1).slice(0, 5)
a.aside-list-item(href=url_for(post.path) title=post.title)
.thumbnail
img(alt=post.title src=url_for(post.cover))
if post.cover
.thumbnail
img(alt=post.title src=url_for(post.cover))
.content
span.title(href=url_for(post.path) title=post.title)= post.title
if post.categories.data[0]
Expand Down
5 changes: 4 additions & 1 deletion layout/includes/widgets/home/banner.pug
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ if icon
.tags-group-icon-pair
each key in pair
.tags-group-icon(style=`background: ${icon[key].color}`)
img.nolazyload(src=icon[key].img, title=key)
if icon[key].img
img.nolazyload(src=icon[key].img, title=key)
else if icon[key].icon
i(class=icon[key].icon, style=`color: ${icon[key].icon_color ? icon[key].icon_color : ''}`)
5 changes: 3 additions & 2 deletions layout/includes/widgets/home/hometop.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
#bannerGroup
#banners
include ./banner.pug
.topGroup
include ./topGroup.pug
if theme.hometop.recommendList.enable
.topGroup
include ./topGroup.pug
10 changes: 6 additions & 4 deletions layout/includes/widgets/home/postList.pug
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ div.recent-post-item(onclick="pjax.loadUrl('" + url_for(post.path) + "')")
else
case position
when 0
div.post_cover
+cover()
if post.cover
div.post_cover
+cover()
div.recent-post-info
+info()
when 1
div.recent-post-info
+info()
div.post_cover
+cover()
if post.cover
div.post_cover
+cover()


if theme.google_adsense && theme.google_adsense.enable && theme.google_adsense.auto_ads === false && theme.google_adsense.post_card
Expand Down
28 changes: 17 additions & 11 deletions layout/includes/widgets/page/about/skillsinfo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@ if skills || careers
.skills-style-group
.tags-group-all
.tags-group-wrapper
each i in [1,2]
- 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}`)
img(src=item.icon, title=item.title)
- pair = []
- 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 = []
.skills-list
each tag in skills.tags
.skill-info
.skill-icon(style=`background:${tag.color}`)
img(src=tag.icon, title=tag.title)
if tag.img
img(src=tag.img, title=tag.title)
else if tag.icon
i(class=tag.icon, title=tag.title, style=`color: ${tag.icon_color ? tag.icon_color : ''}`)

.skill-name
span= tag.title
.etc ...
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/widgets/post/copyright.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.post-copyright
.post-copyright__author_group
a.post-copyright__author_img(href=url_for(copyright.author.url))
img.post-copyright__author_img_front(src=page.avatar || copyright.author.img || theme.site.icon)
img.post-copyright__author_img_front(src=url_for(page.avatar || copyright.author.img || theme.site.icon))
.post-copyright__author_name= page.author || config.title
.post-copyright__author_desc= page.desc || config.subtitle
.post-tools#post-tools
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/widgets/post/postInfo.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#post-info
#post-info(style=`${page.top_color ? 'background: ' + page.top_color : ''}`)
#post-firstinfo
.meta-firstline
- var cc = page.reprint ? _p('post.reprint') : _p('post.original')
Expand Down
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.12",
"version": "2.1.13",
"description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
"main": "package.json",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions scripts/filter/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
hexo.extend.filter.register('after_post_render', function (data) {
data.title = data.title || 'Untitled';
const { config } = hexo.theme;
const defaultCover = ['/img/default.avif'];

const setCoverAndExcerpt = (layout) => {
const { copyright, locate, cover } = hexo.theme.config[layout].default;
data.locate = data.locate || locate;
data.cc = data.cc || copyright;
data.cover = data.cover || (cover?.length ? cover[getRandomInt(0, cover.length)] : defaultCover[0]);
data.cover = data.cover || (cover?.length && cover[getRandomInt(0, cover.length)]);
data.top_color = data.top_color;
data.not_cover = data.cover ? false : true;
data.excerpt = layout === 'post' ? data.description || data.excerpt : data.title;
data.toc = !!(config.aside.toc[layout] && data.toc !== false);
data.aside = layout === 'post' ? (data.aside || true) : (data.aside || false);
Expand Down
2 changes: 1 addition & 1 deletion source/css/_layout/aside.styl
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ if hexo-config('aside.card.style') == 2
.avatar-img
overflow hidden
border-radius 500px
width 74px
width 75px
cursor pointer
height 74px

Expand Down
2 changes: 0 additions & 2 deletions source/css/_layout/recent-post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ else if hexo-config('index_post_list.direction') == "row"
flex-direction row
width 100%
box-shadow var(--efu-shadow-border)
#tag &:first-child
margin-top: 2.5rem

+maxWidth768()
border-radius 12px
Expand Down
4 changes: 2 additions & 2 deletions source/css/_page/_home/home-top.styl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/ #bannerGroup
display flex
+minWidth1201()
width calc(50% - .25rem)
flex 1 1 0
height calc(328px + .5rem)
display flex
flex-direction column
Expand Down Expand Up @@ -70,10 +70,10 @@
display flex
flex-direction row
flex-wrap wrap
flex 1 1 0
justify-content flex-start
height calc(328px + 0.5rem)
align-content space-between
width calc(50% - 0.25rem)
position relative
animation slide-in .6s .1s backwards

Expand Down
16 changes: 8 additions & 8 deletions source/css/_page/error.styl
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
width 100%
padding-bottom 2rem

.error_title
font-size 4rem

.error_title
font-size 9em
line-height 1

+maxWidth768()
font-size 4rem

.error_subtitle
word-break break-word
font-size 1.6em
Expand All @@ -81,12 +81,12 @@
padding .3rem 1.5rem
background var(--btn-bg)
color var(--btn-color)
transition .3s

&:hover
background var(--efu-theme)

i
font-size 16px
padding-right .3rem

.aside-list
Expand All @@ -98,10 +98,7 @@

+maxWidth768()
padding-top 0

.aside-list-item
.thumbnail
height 100px
margin 0

.aside-list-group
display flex
Expand All @@ -127,6 +124,9 @@
background var(--efu-card-bg)
display flex

+maxWidth768()
height 100px

.content .title
-webkit-line-clamp 2
overflow hidden
Expand Down
1 change: 0 additions & 1 deletion source/css/_post/meta.styl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
z-index 1

+minWidth1300()
width 1100px
font-size 2.6rem !important

#post-meta
Expand Down

0 comments on commit 47432a5

Please sign in to comment.