Skip to content

Commit

Permalink
Merge pull request #270 from valor-x/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
everfu authored May 5, 2024
2 parents bfbad76 + 6cc3533 commit ba5c91d
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Efu
Copyright (c) 2024 EverFu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
[![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)

[预览](https://www.efu.me/)[文档](https://solitude.js.org/)
[文档 & 预览](https://solitude.js.org/)

</div>

Expand Down Expand Up @@ -87,4 +87,4 @@

## 版权

[MIT](./LICENSE) License &copy; 2023-至今 [Efu](https://github.com/efuo)
[MIT](./LICENSE) License &copy; 2023-至今 [EverFu](https://github.com/efuo)
4 changes: 2 additions & 2 deletions README_en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
[![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)

[Preview](https://efu.me/)[Documentation](https://solitude.js.org/)
[Documentation & Preview](https://solitude.js.org/)

</div>

Expand Down Expand Up @@ -87,4 +87,4 @@ Check out the [Documentation](https://solitude.js.org/) for more information.

## License

[MIT](./LICENSE) License &copy; 2023-PRESENT [Efu](https://github.com/efuo)
[MIT](./LICENSE) License &copy; 2023-PRESENT [EverFu](https://github.com/efuo)
2 changes: 1 addition & 1 deletion README_zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
[![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
[![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)

[預覽](https://efu.me/)[文档](https://solitude.js.org/)
[文档 & 預覽](https://solitude.js.org/)

</div>

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 @@ -27,7 +27,7 @@ include ../head/pwa.pug

script.
console.log(
"%c Program: Hexo %c Theme: Solitude %c Version: v1.10.1",
"%c Program: Hexo %c Theme: Solitude %c Version: v1.10.2",
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
"padding: 5px 10px;color:white;background:#3e9f50;",
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
Expand Down
3 changes: 2 additions & 1 deletion layout/includes/widgets/page/about/award.pug
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ if site.data.about.rewardList
- var rewards = theme.post.award.list
each reward in rewards
li.reward-item
img.post-qr-code-img(alt=reward.name, src=reward.qcode, style="border-color:" + reward.color)
a(href=url_for(reward.url))
img.post-qr-code-img(alt=reward.name, src=reward.qcode, style="border-color:" + reward.color)
.post-qr-code-desc= reward.name
.reward-list-tips
p= award.tips.replace('{sum}', sum.toFixed(2))
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.10.1",
"description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
"version": "1.10.2",
"description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.",
"main": "package.json",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -11,7 +11,7 @@
"theme",
"solitude",
"Card UI Design",
"Efu",
"EverFu",
"hexo-theme-solitude"
],
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/tags/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function btn(args) {
icon = icon.trim();
option = option.trim();

return `<button class="btn-sco ${option}" onclick="location.href = '${urlFor(url)}'"
return `<button class="btn-sco ${option}" onclick="${url.startsWith("http") ? `window.open('${url}')` : `pjax.loadUrl('${urlFor(url)}')`}"
title="${text}">${icon.length ? `<i class="solitude ${icon}"></i>` : ""}${text.length ? `<span>${text}</span>` : ""}</button>`;
}

Expand Down
11 changes: 6 additions & 5 deletions scripts/tags/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,31 @@ function link(args) {
let link = args[2];
let imgUrl = args[3] || "";
let favicon = themeConfig.site.siteIcon;
let insideStation = false;

link = link.trim();
imgUrl = imgUrl.trim();
favicon = favicon.trim();

try {
new URL(link);
InsideStation = false;
insideStation = false;
} catch (err) {
InsideStation = true;
insideStation = true;
}

if ((imgUrl == "") && (InsideStation == false)) {
if ((imgUrl === "") && (insideStation === false)) {
let domain = new URL(link).hostname
if (domain) {
imgUrl_online = "https://api.iowen.cn/favicon/" + domain + ".png";
}
}

return `<a class="tag-link" target="_blank" href="${urlFor(link)}">
<div class="tag-link-tips">${InsideStation ? "站内链接" : "引用站外链接"
<div class="tag-link-tips">${insideStation ? "站内链接" : "引用站外链接"
}</div>
<div class="tag-link-bottom">
<div class="tag-link-left" style="${InsideStation
<div class="tag-link-left" style="${insideStation
? `background-image: url(${imgUrl ? imgUrl : favicon})`
: `background-image: url(${imgUrl ? imgUrl : imgUrl_online})`
}">
Expand Down
1 change: 1 addition & 0 deletions source/css/_comments/comment.styl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ div#post-comment
border var(--style-border-always)
border-radius 10px
z-index 9999
width 142px
display none
transform translate(0, -105%)
overflow hidden
Expand Down
3 changes: 3 additions & 0 deletions source/css/_comments/valine.styl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
overflow-y: auto;
padding: 10px;

+maxWidth768()
max-width 300px

.vwrap
flex 1
display flex
Expand Down
1 change: 1 addition & 0 deletions source/css/_page/_about/reward.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#about-page
.author-content-item
&.single.reward
overflow unset
.author-content-item
.author-content-item-title
color var(--efu-red)
Expand Down
8 changes: 8 additions & 0 deletions source/css/_post/tools.styl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@
padding 30px 10px 60px
border-radius 12px 12px 0 0

&::before
position absolute
bottom -10px
left 0
width 100%
height 20px
content ""

.reward-title
font-weight 700
color var(--efu-red)
Expand Down
10 changes: 6 additions & 4 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,16 @@ let sco = {
* @description 监听页码输入
*/
listenToPageInputPress: function () {
const toGroup = document.querySelector(".toPageGroup")
const pageText = document.getElementById("toPageText");
if (!pageText) return;
const pageButton = document.getElementById("toPageButton");
const pageNumbers = document.querySelectorAll(".page-number");
const lastPageNumber = +pageNumbers[pageNumbers.length - 1].textContent;
if (!pageText || lastPageNumber === 1) return;
if (!pageText || lastPageNumber === 1) {
toGroup.style.display = "none";
return
}
pageText.addEventListener("keydown", (event) => {
if (event.keyCode === 13) {
sco.toPage();
Expand All @@ -500,8 +504,6 @@ let sco = {
addNavBackgroundInit: function () {
const scrollTop = document.documentElement.scrollTop;
(scrollTop !== 0) && document.getElementById("page-header").classList.add("nav-fixed", "nav-visible");
const cookiesWindow = document.getElementById("cookies-window");
cookiesWindow && (cookiesWindow.style.display = 'none')
},
/**
* initAdjust
Expand Down Expand Up @@ -797,7 +799,7 @@ class tabs {
window.refreshFn = () => {
const {is_home, is_page, page, is_post} = PAGE_CONFIG;
const {runtime, lazyload, lightbox, randomlink, covercolor, post_ai} = GLOBAL_CONFIG;
const timeSelector = is_home || is_page ? '#recent-posts time, .webinfo-item time' : '#post-meta time';
const timeSelector = is_home ? '.post-meta-date time' : is_post ? '.post-meta-date time' : '.datatime'
document.body.setAttribute('data-type', page);
sco.changeTimeFormat(document.querySelectorAll(timeSelector));
runtime && sco.addRuntime();
Expand Down

0 comments on commit ba5c91d

Please sign in to comment.