diff --git a/_config.yml b/_config.yml index 160eeca7..1ea34f42 100644 --- a/_config.yml +++ b/_config.yml @@ -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/ diff --git a/layout/includes/widgets/aside/asideNewestPost.pug b/layout/includes/widgets/aside/asideNewestPost.pug index 468df995..06eeb893 100644 --- a/layout/includes/widgets/aside/asideNewestPost.pug +++ b/layout/includes/widgets/aside/asideNewestPost.pug @@ -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] diff --git a/layout/includes/widgets/home/banner.pug b/layout/includes/widgets/home/banner.pug index eabef46a..fbeed210 100644 --- a/layout/includes/widgets/home/banner.pug +++ b/layout/includes/widgets/home/banner.pug @@ -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) \ No newline at end of file + 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 : ''}`) \ No newline at end of file diff --git a/layout/includes/widgets/home/hometop.pug b/layout/includes/widgets/home/hometop.pug index 495c868c..8112e28e 100644 --- a/layout/includes/widgets/home/hometop.pug +++ b/layout/includes/widgets/home/hometop.pug @@ -3,5 +3,6 @@ #bannerGroup #banners include ./banner.pug - .topGroup - include ./topGroup.pug \ No newline at end of file + if theme.hometop.recommendList.enable + .topGroup + include ./topGroup.pug \ No newline at end of file diff --git a/layout/includes/widgets/home/postList.pug b/layout/includes/widgets/home/postList.pug index ad328872..132eef23 100644 --- a/layout/includes/widgets/home/postList.pug +++ b/layout/includes/widgets/home/postList.pug @@ -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 diff --git a/layout/includes/widgets/page/about/skillsinfo.pug b/layout/includes/widgets/page/about/skillsinfo.pug index 18adac1b..70534a16 100644 --- a/layout/includes/widgets/page/about/skillsinfo.pug +++ b/layout/includes/widgets/page/about/skillsinfo.pug @@ -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 ... diff --git a/layout/includes/widgets/post/copyright.pug b/layout/includes/widgets/post/copyright.pug index a857d374..6ce1a5b8 100644 --- a/layout/includes/widgets/post/copyright.pug +++ b/layout/includes/widgets/post/copyright.pug @@ -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 diff --git a/layout/includes/widgets/post/postInfo.pug b/layout/includes/widgets/post/postInfo.pug index 630c9203..deea3eb1 100644 --- a/layout/includes/widgets/post/postInfo.pug +++ b/layout/includes/widgets/post/postInfo.pug @@ -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') diff --git a/package.json b/package.json index c05d9959..c62ce9b0 100755 --- a/package.json +++ b/package.json @@ -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": { diff --git a/scripts/filter/default.js b/scripts/filter/default.js index 43d8c643..42f749e1 100644 --- a/scripts/filter/default.js +++ b/scripts/filter/default.js @@ -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); diff --git a/source/css/_layout/aside.styl b/source/css/_layout/aside.styl index c30090b1..45a1f106 100644 --- a/source/css/_layout/aside.styl +++ b/source/css/_layout/aside.styl @@ -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 diff --git a/source/css/_layout/recent-post.styl b/source/css/_layout/recent-post.styl index aa585b9f..8c3c3a9f 100644 --- a/source/css/_layout/recent-post.styl +++ b/source/css/_layout/recent-post.styl @@ -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 diff --git a/source/css/_page/_home/home-top.styl b/source/css/_page/_home/home-top.styl index 73b4d2a8..c7685a68 100644 --- a/source/css/_page/_home/home-top.styl +++ b/source/css/_page/_home/home-top.styl @@ -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 @@ -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 diff --git a/source/css/_page/error.styl b/source/css/_page/error.styl index 5b68c116..7b07a0a5 100644 --- a/source/css/_page/error.styl +++ b/source/css/_page/error.styl @@ -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 @@ -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 @@ -98,10 +98,7 @@ +maxWidth768() padding-top 0 - - .aside-list-item - .thumbnail - height 100px + margin 0 .aside-list-group display flex @@ -127,6 +124,9 @@ background var(--efu-card-bg) display flex + +maxWidth768() + height 100px + .content .title -webkit-line-clamp 2 overflow hidden diff --git a/source/css/_post/meta.styl b/source/css/_post/meta.styl index 41c0cc0e..069e9eac 100644 --- a/source/css/_post/meta.styl +++ b/source/css/_post/meta.styl @@ -186,7 +186,6 @@ z-index 1 +minWidth1300() - width 1100px font-size 2.6rem !important #post-meta