Skip to content

Commit

Permalink
Merge pull request #198 from valor-x/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored Apr 1, 2024
2 parents 80aa1ef + 06d874d commit 1793d33
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 80 deletions.
20 changes: 10 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ site:
siteIcon: /img/pwa/favicon.ico
# 页脚的Logo、加载动画默认的logo
# Logo in the footer, default logo for loading animation
icon: /img/avatar.png
icon: /img/pwa/favicon.ico

# 导航栏
# NavBar
Expand All @@ -38,7 +38,7 @@ nav:
# logo group
group:
# 项目: # 分类名称
# Solitude: https://github.com/valor-x/hexo-theme-solitude || /img/logo.png # 子菜单名称(submenu name): 链接地址(address) || 图标(icon)
# Solitude: https://github.com/valor-x/hexo-theme-solitude || /img/pwa/favicon.ico # 子菜单名称(submenu name): 链接地址(address) || 图标(icon)

# 中心菜单
# center menu
Expand Down Expand Up @@ -172,7 +172,7 @@ aside:
author:
# 头像
# Avatar
img: /img/logo.png
img: /img/avatar.png
# 表情图片链接
# Emoticon image link
# tip: 26x26 size
Expand Down Expand Up @@ -452,7 +452,7 @@ footer:
errorpage:
# 图片
# image
img: https://7.isyangs.cn/34/65f2e65eae32a-34.png
img: /img/404.webp
# 文字
# text
text: =awa= 页面走丢了
Expand Down Expand Up @@ -523,7 +523,7 @@ moments:
# example: https://example.com/
api: # https://example.com/
# 加载失败显示图片 / Loading failed display image
error_img: /img/logo.png
error_img: /img/pwa/favicon_64.ico
# 排序规则:created:按创建时间排序 / updated:按更新时间排序
# Sort rule: created: Sort by creation time / updated: Sort by update time
sort_rule: created
Expand Down Expand Up @@ -779,11 +779,11 @@ pwa:
enable: false
manifest: /manifest.json # manifest.json 文件路径
theme_color: "#006a73" # 主题颜色
mask_icon: /img/logo.png # 遮罩图标
apple_touch_icon: /img/logo.png # 苹果触摸图标
bookmark_icon: /img/logo.png # 书签图标
favicon_32_32: /img/logo.png # 32x32图标
favicon_16_16: /img/logo.png # 16x16图标
mask_icon: /img/pwa/favicon.ico # 遮罩图标
apple_touch_icon: /img/pwa/favicon.ico # 苹果触摸图标
bookmark_icon: /img/pwa/favicon.ico # 书签图标
favicon_32_32: /img/pwa/favicon_32.ico # 32x32图标
favicon_16_16: /img/pwa/favicon_16.ico # 16x16图标

# 谷歌广告 (Google Adsense)
google_adsense:
Expand Down
6 changes: 1 addition & 5 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ lately:
ago: ' ago'
error: ' NaN'

chs:
chs_tw: Traditional Chinese
chs_cn: Simplified Chinese

page:
tag: Tags
category: Categories
Expand Down Expand Up @@ -74,11 +70,11 @@ award:
tipping: Tipping
title: List of appreciation


search:
empty: No results found
hit: Found ${query} results for you
placeholder: Enter keywords to quickly search
count: Total <b>${count}</b> results.

head:
noscript: Please enable JavaScript to view the site
Expand Down
5 changes: 1 addition & 4 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ lately:
ago:
error: NaN

chs:
chs_tw: 繁體中文
chs_cn: 简体中文

page:
tag: 标签
category: 分类
Expand Down Expand Up @@ -80,6 +76,7 @@ search:
empty: 找不到你查询的内容:${query}
hit: 找到 ${hits} 条结果,用时 ${time} 毫秒
placeholder: 输入关键词快速查找
count: 共 <b>${count}</b> 条结果。

head:
noscript: 开启JavaScript才能访问本站哦~
Expand Down
5 changes: 1 addition & 4 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ lately:
ago:
error: NaN

chs:
chs_tw: 繁體中文
chs_cn: 簡體中文

page:
tag: 標籤
category: 分類
Expand Down Expand Up @@ -80,6 +76,7 @@ search:
empty: 找不到你查詢的內容:${query}
hit: 找到 ${hits} 條結果,用時 ${time} 毫秒
placeholder: 輸入關鍵詞快速查找
count: 共 <b>${count}<b> 條結果。

head:
noscript: 開啟JavaScript才能訪問本站哦~
Expand Down
74 changes: 40 additions & 34 deletions layout/includes/head/config.pug
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,45 @@
})
}
let lang = false
lang = {
theme: {
dark: _p('theme.dark'),
light: _p('theme.light'),
},
copy: {
success: _p('copy.success'),
error: _p('copy.error'),
},
backtop: _p('nav.backtop'),
lately: {
second: _p('lately.second'),
minute: _p('lately.minute'),
hour: _p('lately.hour'),
day: _p('lately.day'),
month: _p('lately.month'),
year: _p('lately.year'),
ago: _p('lately.ago'),
error: _p('lately.error'),
},
f12: _p('f12'),
}
if (theme.search.enable) {
lang.search = {
empty: _p('search.empty'),
hit: _p('search.hit'),
placeholder: _p('search.placeholder'),
count: _p('search.count')
}
}
if (theme.comment.enable && theme.comment.commentBarrage) {
lang.barrage = {
title: _p('commentBarrage.title'),
}
}
script.
const GLOBAL_CONFIG = {
root: '!{config.root}',
Expand All @@ -105,40 +144,7 @@ script.
syntax: '!{config.syntax_highlighter}'
},
randomlink: !{theme.footer.randomlink},
lang: {
theme: {
dark: '!{_p('theme.dark')}',
light: '!{_p('theme.light')}',
},
copy: {
success: '!{_p('copy.success')}',
error: '!{_p('copy.error')}',
},
backtop: '!{_p('nav.backtop')}',
lately: {
second: '!{_p('lately.second')}',
minute: '!{_p('lately.minute')}',
hour: '!{_p('lately.hour')}',
day: '!{_p('lately.day')}',
month: '!{_p('lately.month')}',
year: '!{_p('lately.year')}',
ago: '!{_p('lately.ago')}',
error: '!{_p('lately.error')}',
},
search: {
empty: '!{_p('search.empty')}',
hit: '!{_p('search.hit')}',
placeholder: '!{_p('search.placeholder')}',
},
chs: {
chs_to_cht: '!{_p('chs.chs_tw')}',
cht_to_chs: '!{_p('chs.chs_cn')}',
},
barrage: {
title: '!{_p('commentBarrage.title')}',
},
f12: '!{_p('f12')}',
},
lang: !{JSON.stringify(lang)},
aside: {
sayhello: {
morning: '!{theme.aside.card.sayhello.morning}',
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/inject/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ script.
)(window)

console.log(
"%c Program: Hexo %c Theme: Solitude %c Version: v1.7.2",
"%c Program: Hexo %c Theme: Solitude %c Version: v1.7.3",
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
"padding: 5px 10px;color:white;background:#3e9f50;",
"border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
Expand Down
4 changes: 2 additions & 2 deletions layout/includes/page/says.pug
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if theme.says.enable
if item.image
.bber-content-img
each img in item.image
img(src=img title="即刻短文配图")
img(src=img alt="image")

if item.aplayer
.bber-music
Expand All @@ -41,7 +41,7 @@ if theme.says.enable
i.solitude.st-calendar-todo-fill
time.datetime(datetime=moment(item.date).format())
if item.link
a.bber-content-link(href=url_for(item.link) title="跳转到短文指引的链接" target="_blank")
a.bber-content-link(href=url_for(item.link) target="_blank")
i.solitude.st-link-m-line
| 链接
if item.content
Expand Down
3 changes: 2 additions & 1 deletion layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ block content
span.tagsPageCount #{data.length}
if site.posts.length > 1
include includes/widgets/post/postNav
!= related_posts(page, site.posts)
if theme.related_post.enable
!= related_posts(page, site.posts)
if page.comment
include includes/widgets/third-party/comments/comment
include includes/widgets/aside/aside
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hexo-theme-solitude",
"version": "1.7.2",
"description": "A beautiful, powerful, and efficient Hexo theme developed by the wleelw",
"version": "1.7.3",
"description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
"main": "package.json",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -26,7 +26,7 @@
"url": "https://github.com/valor-x/hexo-theme-solitude/issues",
"email": "[email protected]"
},
"homepage": "https://solitude-demo.efu.me/",
"homepage": "https://efu.me/",
"author": "Hexo-Theme-Solitude<[email protected]>",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion scripts/event/merge_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hexo.extend.filter.register('before_generate', () => {
site: {
name: {
class: 'text', custom: 'Solitude'
}, siteIcon: '/img/logo.png', icon: 'icon'
}, siteIcon: '/img/pwa/favicon.ico', icon: 'icon'
}, nav: {
group: null, menu: null, right: {
random: false, console: false, custom: [],
Expand Down
16 changes: 7 additions & 9 deletions scripts/event/welcome.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
hexo.on('ready', () => {
const {version} = require('../../package.json')
hexo.log.info(`
===================================================================
##### #### # ##### ###### # # ###### ######
# # # # # # # # # # #
##### # # # # # # # # # ######
# # # # # # # # # # #
###### #### ##### ##### # ### ###### ######
${version}
===================================================================
GitHub: https://github.com/valor-x/hexo-theme-solitude
╭─────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Theme: Solitude │
│ Version: v${version}
│ Changelog: https://github.com/valor-x/hexo-theme-solitude/releases/tag/v${version}
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
`)
})
2 changes: 1 addition & 1 deletion source/css/_page/_about/about.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#$about-page
#about-page
display flex
padding-top 1rem
flex-direction column
Expand Down
2 changes: 1 addition & 1 deletion source/css/_page/other.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
div#banners
display none
+minWidth1200()
+minWidth1201()
display flex
width 100%
height 100%
Expand Down
Binary file added source/img/404.webp
Binary file not shown.
Binary file added source/img/pwa/favicon_512.ico
Binary file not shown.
7 changes: 3 additions & 4 deletions source/js/search/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ window.onload = () => {
searchClickFn();

function initLunr() {
fetch("/search.xml")
fetch(GLOBAL_CONFIG.localsearch.path)
.then(response => response.text())
.then(data => {
let parser = new DOMParser();
Expand Down Expand Up @@ -128,14 +128,13 @@ window.onload = () => {
const $link = document.createElement("a");
$link.className = "search-result-title";
$link.href = result.link;
const title = highlightSearchKeyword(result.title, query);
$link.innerHTML = title;
$link.innerHTML = highlightSearchKeyword(result.title, query);
$result.appendChild($link);
$search_results.appendChild($result);
});
const count = document.createElement("span");
count.className = "search-result-count";
count.innerHTML = `共 <b>${results.length}</b> 条结果`;
count.innerHTML = GLOBAL_CONFIG.lang.search.count.replace(/\$\{count}/, results.length)
$tips.appendChild(count);
}

Expand Down

0 comments on commit 1793d33

Please sign in to comment.