Skip to content

Commit 0187cf4

Browse files
authored
Merge pull request #426 from EvanNotFound/dev
v2.7.0
2 parents b22c187 + 0a1c561 commit 0187cf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+477
-208
lines changed

.coderabbit.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: false
7+
high_level_summary: true
8+
poem: false
9+
review_status: true
10+
collapse_walkthrough: true
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
chat:
15+
auto_reply: true

.github/workflows/preview-deployment.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
11
name: Vercel Preview Deployment
2+
23
env:
34
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
45
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
57
on:
68
workflow_dispatch:
79
push:
810
branches:
911
- dev
10-
pull_request: # Trigger the workflow on pull request activities
12+
pull_request_target:
1113
branches:
1214
- dev
1315
- main
1416

1517
jobs:
1618
preview-deployment:
1719
runs-on: ubuntu-latest
20+
environment:
21+
name: ${{ github.event_name == 'pull_request_target' && 'PR Preview' || 'Preview' }}
22+
url: ${{ steps.deploy-to-vercel.outputs.preview-url }}
1823
steps:
19-
- id: script
24+
- name: Determine checkout details
25+
id: checkout-details
2026
uses: actions/github-script@v7
2127
with:
2228
script: |
23-
const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)
24-
core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)
25-
core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)
29+
const isPr = context.eventName === 'pull_request_target'
30+
const ref = isPr ? context.payload.pull_request.head.ref : context.ref
31+
const repo = isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name
32+
core.setOutput('ref', ref)
33+
core.setOutput('repo', repo)
2634
2735
- name: Checkout theme repository
2836
uses: actions/checkout@v4
2937
with:
30-
path: 'theme' # Checkout the theme repository into a directory named 'theme'
31-
ref: ${{ steps.script.outputs.ref }}
32-
repository: ${{ steps.script.outputs.repo }}
38+
path: 'theme'
39+
ref: ${{ steps.checkout-details.outputs.ref }}
40+
repository: ${{ steps.checkout-details.outputs.repo }}
41+
3342

3443
- name: Setup Node.js
3544
uses: actions/setup-node@v4
@@ -98,6 +107,7 @@ jobs:
98107
run: echo "HEXO_SITE_DIR=${{ github.workspace }}/hexo-site" >> $GITHUB_ENV
99108

100109
- name: Deploy to Vercel Action
110+
id: deploy-to-vercel
101111
uses: EvanNotFound/vercel-deployment-for-github-actions@v1.1.0
102112
with:
103113
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DONATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A big thank you to all the friends who have sponsored this project. Your support
3333
| ![IMG_0382](https://user-images.githubusercontent.com/68590232/223455834-d2e5ab6e-9d75-4bbf-adfb-2c519d6b4582.JPG) | ![IMG_9570](https://user-images.githubusercontent.com/68590232/223463950-f7276ef8-0198-4070-8541-697ec25e5b9a.png) | ![IMG_0385](https://user-images.githubusercontent.com/68590232/223459896-593e105e-89f3-4631-8cab-cb7798a53bf1.jpg) |
3434

3535

36-
赞助完以后,请各位加我微信 `do-not-go-plzzz` 联系我添加 GitHub 账号和网站链接!
36+
赞助完以后,请各位加我微信,在 [evannotfound.com/contact](https://evannotfound.com/contact) 联系我添加 GitHub 账号和网站链接!
3737
After making a donation, if you want to get in touch with me, please add me on Discord with my username `evannotfound`.
3838

3939
感谢!
@@ -77,4 +77,4 @@ Thank you!
7777
| Oct 16 |*| ¥20.00 | 微信赞赏码 | - |
7878
| Oct 24 | Neptune. | ¥14.99 | 微信赞赏码 | - |
7979
| Nov 26 | **| ¥25.00 | 支付宝 | - |
80-
| Nov 27 | :-) | ¥16.66 | 微信 | - |
80+
| Nov 27 | :-) | ¥16.66 | 微信 | - |

_config.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ colors:
4646
# SITE CUSTOMIZATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
4747
# Docs: https://redefine-docs.ohevan.com/basic/global
4848
global:
49-
# Custom fonts
49+
# Custom global fonts
5050
fonts:
5151
# Chinese fonts
5252
chinese:
@@ -58,6 +58,11 @@ global:
5858
enable: false # Whether to enable custom english fonts
5959
family: # Font family
6060
url: # Font URL to CSS file
61+
# Custom title fonts (navbar, sidebar)
62+
title:
63+
enable: false # Whether to enable custom title fonts
64+
family: # Font family
65+
url: # Font URL to CSS file
6166
# Content max width
6267
content_max_width: 1000px
6368
# Sidebar width
@@ -80,7 +85,9 @@ global:
8085
# Whether to enable single page experience (using swup). See https://swup.js.org/. similar to pjax
8186
single_page: true
8287
# Whether to enable Preloader.
83-
preloader: true
88+
preloader:
89+
enable: false
90+
custom_message: # Custom message. If empty, the site title will be displayed
8491
# Whether to enable open graph
8592
open_graph: true
8693
# Google Analytics
@@ -122,6 +129,7 @@ home_banner:
122129
text: [] # subtitle text, array
123130
hitokoto: # 一言配置
124131
enable: false # Whether to enable hitokoto
132+
show_author: false # Whether to show author
125133
api: https://v1.hitokoto.cn # API URL, can add types, see https://developer.hitokoto.cn/sentence/#%E5%8F%A5%E5%AD%90%E7%B1%BB%E5%9E%8B-%E5%8F%82%E6%95%B0
126134
typing_speed: 100 # Typing speed (ms)
127135
backing_speed: 80 # Backing speed (ms)
@@ -241,6 +249,8 @@ home:
241249
# ...... # you can add more
242250
# Article date format
243251
article_date_format: auto # auto, relative, YYYY-MM-DD, YYYY-MM-DD HH:mm:ss etc.
252+
# Article excerpt length
253+
excerpt_length: 200 # Max length of article excerpt
244254
# Article categories visibility
245255
categories:
246256
enable: true # Whether to enable
@@ -285,6 +295,9 @@ articles:
285295
code_block:
286296
copy: true # Whether to enable code block copy button
287297
style: mac # mac | simple
298+
highlight_theme: # Color scheme for highlightjs code highlighting. For preview, see https://highlightjs.org/examples
299+
light: github # light mode theme, support: github, atom-one-light, default
300+
dark: vs2015 # dark mode theme, support: github-dark, monokai-sublime, vs2015, night-owl, atom-one-dark, nord, tokyo-night-dark, a11y-dark, agate
288301
font: # Custom font
289302
enable: false # Whether to enable
290303
family: # Font family
@@ -446,7 +459,7 @@ cdn:
446459
# Whether to enable CDN
447460
enable: false
448461
# CDN Provider
449-
provider: npmmirror # npmmirror, zstatic, sustech, staticfile, bootcdn, cdnjs, jsdelivr, unpkg, custom
462+
provider: npmmirror # npmmirror, zstatic, sustech, cdnjs, jsdelivr, unpkg, custom
450463
# Custom CDN URL
451464
# format example: https://cdn.custom.com/hexo-theme-redefine/${version}/source/${path}
452465
# The ${path} must leads to the root of the "source" folder of the theme

languages/en.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ archive: Archive
2727
archives: Archives
2828
top: TOP
2929
sticky: Sticky
30+
go-back-home: Go Back Home
3031

3132

3233
# ----------------------------------------
3334
# Menu Translation
3435
# ----------------------------------------
3536
about: About
3637
changelog: Changelog
37-
status: Status
3838
links: Links
3939
link: Link
4040
friends: Friends
@@ -50,7 +50,7 @@ site_pv: TOTAL PAGE VIEWS
5050
read_more: Read more
5151
wordcount: Words
5252
min2read: Mins
53-
53+
status: Status
5454

5555
# ----------------------------------------
5656
# Footer

languages/ja.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 网站翻译
33
# ----------------------------------------
44
search: 検索...
5-
toc: このページの目次
5+
toc: 目次
66
prev: 前のページ
77
next: 次のページ
88
prev_posts: 前一篇
@@ -24,6 +24,7 @@ comment: コメント
2424
comments: コメント
2525
top: トップ
2626
sticky: 屋根
27+
go-back-home: トップページに戻ります
2728

2829
# ----------------------------------------
2930
# 菜单翻译

languages/zh-CN.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ----------------------------------------
22
# 网站翻译
33
# ----------------------------------------
4-
search: 搜索...
5-
toc: 此页目录
4+
search: 站内搜索您需要的内容...
5+
toc: 目录
66
prev: 上一页
77
next: 下一页
88
prev_posts: 上一篇
@@ -24,6 +24,7 @@ comment: 评论
2424
comments: 评论
2525
top: 置顶
2626
sticky: 置顶
27+
go-back-home: 回到首页
2728

2829
# ----------------------------------------
2930
# 菜单翻译
@@ -61,7 +62,7 @@ seconds: 秒
6162

6263
optimized_by: 并由 Evan 进行优化
6364
rights: 版权所有
64-
site_posts: " %s 篇文章"
65+
site_posts: "共撰写了 %s 篇文章"
6566
site_wordcount: "共 %s 字"
6667

6768
# ----------------------------------------
@@ -91,4 +92,4 @@ ago:
9192

9293
create_time: 创建
9394
update_time: 更新
94-
expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。"
95+
expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。"

languages/zh-TW.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ----------------------------------------
22
# 网站翻译
33
# ----------------------------------------
4-
search: 搜尋...
5-
toc: 此頁目錄
4+
search: 站內搜尋您想要的內容...
5+
toc: 目錄
66
prev: 上一頁
77
next: 下一頁
88
prev_posts: 上一篇
@@ -24,6 +24,7 @@ comment: 留言
2424
comments: 留言
2525
top: 頂端
2626
sticky: 置頂
27+
go-back-home: 回到首頁
2728

2829
# ----------------------------------------
2930
# 菜单翻译
@@ -90,4 +91,4 @@ ago:
9091

9192
create_time: 撰寫
9293
update_time: 更新
93-
expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。"
94+
expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。"

layout/_partials/404-template.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div class="nf-container">
22
<div class="nf-text">
3-
<h1>404 Page Not Found</h1>
3+
<h1>404<br>Page Not Found</h1>
44
</div>
55
<div class="nf-button">
6-
<a href="/" class="button large center"><i class="fa-regular fa-house"></i> Go Back Home</a>
6+
<a href="/" class="button large center"><i class="fa-regular fa-house"></i> __("go-back-home")</a>
77
</div>
8-
</div>
8+
</div>

layout/_partials/comments/gitalk.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
) { %>
88
<div id="gitalk-container"></div>
99
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>
10-
src="//cdn.staticfile.org/gitalk/1.8.0/gitalk.min.js"></script>
10+
src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.8.0/gitalk.min.js"></script>
1111
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>>
1212
1313
function loadGitalk() {

layout/_partials/comments/twikoo.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% if(theme.comment.system === 'twikoo' && theme.comment.config.twikoo.server_url) { %>
22
<div class="twikoo-container">
33
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>
4-
src='https://cdn.staticfile.org/twikoo/<%- theme.comment.config.twikoo.version %>/twikoo.all.min.js'
4+
src='https://cdnjs.cloudflare.com/ajax/libs/twikoo/<%- theme.comment.config.twikoo.version %>/twikoo.all.min.js'
55
></script>
66
<div id="twikoo-comment"></div>
77
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>>

layout/_partials/head.ejs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
<% const cdnLinks = {
1616
'jsdelivr': 'https://cdn.jsdelivr.net',
1717
'unpkg': 'https://unpkg.com',
18-
'personal': 'https://evan.beee.top',
18+
'aliyun': 'https://evan.beee.top',
1919
'cdnjs': 'https://cdnjs.cloudflare.com',
20-
'bootcdn': 'https://cdn.bootcdn.net',
21-
'staticfile': 'https://cdn.staticfile.org'
20+
'sustech': 'https://mirrors.sustech.edu.cn',
21+
'zstatic': 'https://s4.zstatic.net',
22+
'npmmirror': 'https://registry.npmmirror.com',
23+
2224
}; %>
2325
<% if (cdnLinks[provider]) { %>
2426
<link rel="preconnect" href="<%= cdnLinks[provider] %>" crossorigin>
@@ -110,8 +112,10 @@
110112
<% if (theme.global.fonts.english.enable) { %>
111113
<link href="<%- theme.global.fonts.english.url %>" rel="stylesheet">
112114
<% } %>
113-
114-
<% if (theme.global.preloader) { %>
115+
<% if (theme.global.fonts.title.enable) { %>
116+
<link href="<%- theme.global.fonts.title.url %>" rel="stylesheet">
117+
<% } %>
118+
<% if (theme.global.preloader === true || theme.global.preloader.enable === true) { %>
115119
<%- renderJS('js/libs/anime.min.js')%>
116120
<% } %>
117121

layout/_partials/home-content.ejs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
<% } else if (post.excerpt && post.excerpt !== "false") { %>
4444
<%- render(post.excerpt, "markdown") %>
4545
<% } else { %>
46-
<%- truncate(strip_html(post.content), {length: 128}) %>
46+
<%
47+
const excerptLength = theme.home.excerpt_length || 200;
48+
%>
49+
<%- truncate(strip_html(post.content), {length: excerptLength}) %>
4750
<% } %>
4851
</div>
4952

layout/_partials/preloader.ejs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767

6868
<div class="preloader">
6969
<h2 class="ml13">
70-
<%= theme.info.title %>
70+
<%=
71+
theme.global.preloader.custom_message || theme.info.title
72+
%>
7173
</h2>
7274
<script>
7375
var textWrapper = document.querySelector('.ml13');

layout/_partials/scripts.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<%- renderJSModule('js/plugins/masonry.js') %>
4242
<% } %>
4343

44-
<% if (!theme.global.preloader) { %>
44+
<% if (theme.global.preloader === false || theme.global.preloader.enable === false) { %>
4545
<%- renderJS('js/libs/anime.min.js')%>
4646
<% } %>
4747

layout/_widgets/archive-list.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
</div>
99
<% let previousDate = null; %>
1010
<ul class="article-list pl-0 md:pl-8 text-lg leading-[1.5]">
11-
<% postYear.postList.forEach(post => { %>
11+
<% postYear.postList.sort((a,b) => (a.date > b.date ? -1 : (a.date < b.date ? 1 : a.title.localeCompare(b.title)))).forEach(post => { %>
1212
<% const currentDate = date(post.date, 'MM-DD'); %>
1313
<% if (previousDate !== currentDate) { %>
1414
<% if (previousDate) { %>
1515
</li>
1616
<% } %> <!-- Close the previous LI if not the first item -->
1717
<li class="article-item space-y-2 px-6 pt-10 pb-2 text-xl relative border-l-2 border-border-color" date-is='<%= currentDate %>'>
1818
<% } %>
19-
<a href="<%- url_for(post.path) %>" class="block overflow-hidden w-fit">
19+
<a href="<%- url_for(post.path) %>" class="block w-fit">
2020
<span class="article-title my-0.5 text-2xl"><%= post.title %></span>
2121
</a>
2222
<% previousDate = currentDate; %>

layout/_widgets/essays.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<li class="w-full flex flex-row relative">
1111
<div class="w-10 h-10 mr-4 rounded-lg overflow-hidden border border-border-color p-[1px] flex-shrink-0"><%- image_tag(theme.defaults.avatar, {class: "w-full h-full rounded-[6.2px]"}) %></div>
1212
<div class="w-full border-border-color rounded-xl rounded-tl-none redefine-box-shadow-flat overflow-hidden">
13-
<div class="px-4 py-1.5 text-sm border-b border-border-color bg-zinc-50 dark:bg-zinc-800 text-third-text-color"><%- moment(e.date).locale(config.language).calendar() %></div>
13+
<div class="px-4 py-1.5 text-sm border-b border-border-color bg-zinc-50 dark:bg-zinc-800 text-third-text-color"><%- moment(e.date).utc().locale(config.language).calendar() %></div>
1414
<div id="shuoshuo-content" class="px-4 py-2"><%- markdown(e.content) %></div>
1515
</div>
1616
<div class=" absolute left-[50.5px] top-3 transform w-2 h-2 border-solid border-t border-l bg-zinc-50 -rotate-45 border-border-color dark:bg-zinc-800"></div>

layout/_widgets/tagcloud.ejs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<% if (site.tags.length){ %>
22
<div class="tagcloud-container">
33
<div>
4-
<h1 class="tagcloud-header"><%- __('tags') %></h1>
4+
<h1 class="tagcloud-header">
5+
<% const useCustomTitle = page.title.toLowerCase() !== "tags" && page.title.toLowerCase() !=="tag" && page.title !=="标签" %>
6+
<% if (useCustomTitle) { %>
7+
<%= page.title %>
8+
<% } else { %>
9+
<%- __('tags') %>
10+
<% } %>
11+
</h1>
512
</div>
613
714
<% if (theme.page_templates.tags_style == 'cloud') { %>

0 commit comments

Comments
 (0)