Skip to content

Commit

Permalink
Merge pull request #365 from everfu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Aug 21, 2024
2 parents db7fa66 + da9b2cc commit 18b8a62
Show file tree
Hide file tree
Showing 20 changed files with 715 additions and 594 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ English丨[简体中文](README_zh-Hans.md)丨[繁体中文](README_zh-Hant.md)
[![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)

[Documentation](https://solitude.js.org/)[Preview](https://everfu.github.io/Solitude/)
[Documentation](https://solitude.js.org/)[Preview](https://solitude.js.org/preview/)

</div>

Expand Down
6 changes: 3 additions & 3 deletions README_zh-Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1>Solitude</h1>

一款优雅的 Hexo 主题,支持懒加载、PWA、Latex 以及多种评论系统。

主题设计由 [@张洪Heo](https://github.com/zhheo) 全权授权

![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?style=for-the-badge)
Expand All @@ -20,7 +20,7 @@
[![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)

[文档](https://solitude.js.org/)[预览](https://everfu.github.io/Solitude/)
[文档](https://solitude.js.org/)[预览](https://solitude.js.org/preview/zh/)

</div>

Expand Down Expand Up @@ -58,7 +58,7 @@
```yaml
theme: solitude
```

前往 [文档](https://solitude.js.org/) 获取更多信息。

## 赞助者
Expand Down
4 changes: 2 additions & 2 deletions README_zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)

[文档](https://solitude.js.org/)[預覽](https://everfu.github.io/Solitude/)
[文档](https://solitude.js.org/)[預覽](https://solitude.js.org/preview/zh/)

</div>

Expand All @@ -36,7 +36,7 @@
- 評論(Twikoo、Waline、Valine、Artalk、Giscus),支援雙評論
- 晝夜切換(ColorMode)
- 燈箱(medium-zoom、fancybox)
- 數學公式(Latex)
- 數學公式(Latex)
- 特色頁面:即刻短文、我的裝備、在線工具、音樂館、友鏈魚塘、相冊頁、豆瓣頁、留言彈幕頁。
- 文章功能:AI 摘要、代碼高亮。

Expand Down
14 changes: 12 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ post:
enable: true
author:
url: /about/ # Author link
# Default icon is not filled in
# 不填显示默认图标
# Default use site.icon
# 默认使用 site.icon
img:
# License
# 许可证
Expand Down Expand Up @@ -626,6 +626,16 @@ mediumZoom: false # mediumZoom
mermaid: false
# --------------------------- end ---------------------------

# --------------------------- start ---------------------------
# Chart.js
chart: false
# --------------------------- end ---------------------------

# --------------------------- start ---------------------------
# typeit
typeit: false
# --------------------------- end ---------------------------

# --------------------------- start ---------------------------
# OpenGraph
OpenGraph:
Expand Down
206 changes: 106 additions & 100 deletions layout/includes/inject/body.pug
Original file line number Diff line number Diff line change
@@ -1,112 +1,118 @@
- page.type = is_post() ? 'post' : page.type

mixin katex
if theme.katex.copytex
script(src=url_for(theme.cdn.katex_copytex))
script.
(() => {
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
utils.wrap(item, 'div', {class: 'katex-wrap'})
})
})();
if theme.katex.copytex
script(src=url_for(theme.cdn.katex_copytex))
script.
(() => {
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
utils.wrap(item, 'div', {class: 'katex-wrap'})
})
})();

div
script(src=url_for(theme.cdn.utils))
script(src=url_for(theme.cdn.main))
script(src=url_for(theme.cdn.waterfall))
script(src=url_for(theme.cdn.pjax))

if theme.post.share.enable && theme.post.share.list && theme.post.share.list.includes('qrcode')
script(src=url_for(theme.cdn.qrcode))

if theme.mermaid
script(src=url_for(theme.cdn.mermaid_js))

if theme.display_mode.universe
script(src=url_for(theme.cdn.universe_js))
script.
dark()

if theme.right_menu.enable && theme.right_menu.translate.enable
script(src=url_for(theme.cdn.translate_js))

if theme.katex && theme.katex.enable
if theme.katex.per_page && (is_post() || is_page())
+katex
else if page.katex
+katex

if theme.lazyload.enable
script(src=url_for(theme.cdn.lazyload))
script(src=url_for(theme.cdn.snackbar))
if theme.lightbox
if theme.mediumZoom
script(src=url_for(theme.cdn.medium_zoom))
if theme.fancybox
script(src=url_for(theme.cdn.fancyapps_ui))
if (theme.says.home_mini && theme.says.enable) || theme.carousel
script(src=url_for(theme.cdn.swiper_js))

if theme.post_ai.enable
script(src=url_for(theme.cdn.efu_ai))

if theme.capsule.enable || theme.music.enable || theme.says.enable
script(src=url_for(theme.cdn.utils))
script(src=url_for(theme.cdn.main))
script(src=url_for(theme.cdn.waterfall))
script(src=url_for(theme.cdn.pjax))

if theme.post.share.enable && theme.post.share.list && theme.post.share.list.includes('qrcode')
script(src=url_for(theme.cdn.qrcode))

if theme.mermaid
script(src=url_for(theme.cdn.mermaid_js))

if theme.chart
script(src=url_for(theme.cdn.chart_js))

if theme.typeit
script(src=url_for(theme.cdn.typeit_js))

if theme.display_mode.universe
script(src=url_for(theme.cdn.universe_js))
script.
dark()

if theme.right_menu.enable && theme.right_menu.translate.enable
script(src=url_for(theme.cdn.translate_js))

if theme.katex && theme.katex.enable
if theme.katex.per_page && (is_post() || is_page())
+katex
else if page.katex
+katex

if theme.lazyload.enable
script(src=url_for(theme.cdn.lazyload))
script(src=url_for(theme.cdn.snackbar))
if theme.lightbox
if theme.mediumZoom
script(src=url_for(theme.cdn.medium_zoom))
if theme.fancybox
script(src=url_for(theme.cdn.fancyapps_ui))
if (theme.says.home_mini && theme.says.enable) || theme.carousel
script(src=url_for(theme.cdn.swiper_js))

if theme.post_ai.enable
script(src=url_for(theme.cdn.efu_ai))

if theme.capsule.enable || theme.music.enable || theme.says.enable
script.
var meting_api = '!{theme.meting_api}';
script(src=url_for(theme.cdn.aplayer_js))
script(src=url_for(theme.cdn.meting_js))

if theme.post.covercolor.enable
case theme.post.covercolor.mode
when 'local'
script(src=url_for(theme.cdn.cover_local))
when 'api'
script.
var meting_api = '!{theme.meting_api}';
script(src=url_for(theme.cdn.aplayer_js))
script(src=url_for(theme.cdn.meting_js))

if theme.post.covercolor.enable
case theme.post.covercolor.mode
when 'local'
script(src=url_for(theme.cdn.cover_local))
when 'api'
script.
const coverColorConfig = {
api: '!{theme.post.covercolor.api}',
time: !{theme.post.covercolor.time}
}
script(src=url_for(theme.cdn.cover_api))

if theme.loading.pace
script(src=url_for(theme.cdn.pace_js))

if theme.search.enable && theme.search.type === "algolia"
script(src=url_for(theme.cdn.instantsearch))
script(src=url_for(theme.cdn.algolia_search))

if theme.right_menu.enable
script(src=url_for(theme.cdn.right_menu_js))

if theme.extends.body
each item in theme.extends.body
!= item

.js-pjax
if is_home() && theme.says.enable && theme.says.home_mini
script.
sco.initbbtalk()
if page.type === 'says' && theme.says.enable
script.
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
sco.changeTimeFormat(document.querySelectorAll('.bber-info-time time'))
if comment_js
include ../widgets/third-party/comments/js
if theme.mermaid
script.
mermaid.run();
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_use === 0
script(defer pjax src=url_for(theme.cdn.busuanzi_js))
else
script(defer pjax src=url_for(theme.cdn.busuanzi_qj_js))
const coverColorConfig = {
api: '!{theme.post.covercolor.api}',
time: !{theme.post.covercolor.time}
}
script(src=url_for(theme.cdn.cover_api))

if theme.loading.pace
script(src=url_for(theme.cdn.pace_js))

if theme.search.enable && theme.search.type === "algolia"
script(src=url_for(theme.cdn.instantsearch))
script(src=url_for(theme.cdn.algolia_search))

if theme.right_menu.enable
script(src=url_for(theme.cdn.right_menu_js))

if theme.extends.body
each item in theme.extends.body
!= item

.js-pjax
if is_home() && theme.says.enable && theme.says.home_mini
script.
sco.initbbtalk()
if page.type === 'says' && theme.says.enable
script.
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
sco.changeTimeFormat(document.querySelectorAll('.bber-info-time time'))
if comment_js
include ../widgets/third-party/comments/js
if theme.mermaid
script.
mermaid.run();
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_use === 0
script(defer pjax src=url_for(theme.cdn.busuanzi_js))
else
script(defer pjax src=url_for(theme.cdn.busuanzi_qj_js))


if theme.footer.randomlink
include ../widgets/randomlink.pug
include ../widgets/randomlink.pug

// pjax
!= partial("includes/widgets/third-party/pjax", {}, {cache: true})
Expand Down
10 changes: 5 additions & 5 deletions layout/includes/widgets/home/topGroup.pug
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- var filteredPosts = site.posts.data.filter(item => item.recommend === true).slice(0,6)
.recent-post-group
.top-post-group
each post in filteredPosts
.recent-post-item
.top-post-item
.post_cover
a(href=url_for(post.path), title=post.title)
span.recent-post-top-text= _p('home.recommend')
span.top-post-top-text= _p('home.recommend')
img.post_bg(alt=post.title, src=url_for(post.cover))
.recent-post-info
.top-post-info
a.article-title(href=url_for(post.path), title=post.title)= post.title

mixin todayCardContent
Expand All @@ -29,4 +29,4 @@ case theme.hometop.recommendList.url.startsWith('/')
window.open("#{theme.hometop.recommendList.url}", "_blank");
}
.todayCard#todayCard(onclick="GoTodayCard()")
+todayCardContent()
+todayCardContent()
2 changes: 1 addition & 1 deletion layout/includes/widgets/post/copyright.pug
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
a(href=url_for(theme.post.default.copyright.licenurl))
| #{theme.post.default.copyright.license}
= _p('post.copyright.original_end')
a(href=url_for("/")) #{config.title}
a(href=url_for("/")) #{config.title}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hexo-theme-solitude",
"version": "2.0.9",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"version": "2.0.10",
"description": "A beautiful, powerful, and efficient Hexo theme developed by Ever Fu.",
"main": "package.json",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -11,7 +11,7 @@
"theme",
"solitude",
"Card UI Design",
"EverFu",
"Ever Fu",
"hexo-theme-solitude"
],
"repository": {
Expand All @@ -26,7 +26,7 @@
"url": "https://github.com/everfu/hexo-theme-solitude/issues",
"email": "o@everfu.org"
},
"homepage": "https://everfu.github.io/Solitude/",
"homepage": "https://solitude.js.org",
"author": "Hexo-Theme-Solitude<o@everfu.org>",
"license": "MIT"
}
12 changes: 11 additions & 1 deletion plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,18 @@ fancyapps_css:
other_name: fancyapps-ui
mermaid_js:
name: mermaid
file: dist/mermaid.min.js
file: dist/mermaid.js
version: 10.9.1
chart_js:
name: chart.js
file: dist/chart.umd.js
version: 4.4.1
other_name: Chart.js
typeit_js:
name: typeit
file: index.umd.min.js
version: 8.8.4
other_name: typeit
blueimp_md5:
name: blueimp-md5
file: js/md5.min.js
Expand Down
Loading

0 comments on commit 18b8a62

Please sign in to comment.