Skip to content

Commit

Permalink
Merge pull request #426 from EvanNotFound/dev
Browse files Browse the repository at this point in the history
v2.7.0
  • Loading branch information
EvanNotFound authored Aug 31, 2024
2 parents b22c187 + 0a1c561 commit 0187cf4
Show file tree
Hide file tree
Showing 46 changed files with 477 additions and 208 deletions.
15 changes: 15 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: true
auto_review:
enabled: true
drafts: false
chat:
auto_reply: true
26 changes: 18 additions & 8 deletions .github/workflows/preview-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
name: Vercel Preview Deployment

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
workflow_dispatch:
push:
branches:
- dev
pull_request: # Trigger the workflow on pull request activities
pull_request_target:
branches:
- dev
- main

jobs:
preview-deployment:
runs-on: ubuntu-latest
environment:
name: ${{ github.event_name == 'pull_request_target' && 'PR Preview' || 'Preview' }}
url: ${{ steps.deploy-to-vercel.outputs.preview-url }}
steps:
- id: script
- name: Determine checkout details
id: checkout-details
uses: actions/github-script@v7
with:
script: |
const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)
core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)
core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)
const isPr = context.eventName === 'pull_request_target'
const ref = isPr ? context.payload.pull_request.head.ref : context.ref
const repo = isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name
core.setOutput('ref', ref)
core.setOutput('repo', repo)
- name: Checkout theme repository
uses: actions/checkout@v4
with:
path: 'theme' # Checkout the theme repository into a directory named 'theme'
ref: ${{ steps.script.outputs.ref }}
repository: ${{ steps.script.outputs.repo }}
path: 'theme'
ref: ${{ steps.checkout-details.outputs.ref }}
repository: ${{ steps.checkout-details.outputs.repo }}


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

- name: Deploy to Vercel Action
id: deploy-to-vercel
uses: EvanNotFound/vercel-deployment-for-github-actions@v1.1.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions DONATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A big thank you to all the friends who have sponsored this project. Your support
| ![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) |


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

感谢!
Expand Down Expand Up @@ -77,4 +77,4 @@ Thank you!
| Oct 16 |*| ¥20.00 | 微信赞赏码 | - |
| Oct 24 | Neptune. | ¥14.99 | 微信赞赏码 | - |
| Nov 26 | **| ¥25.00 | 支付宝 | - |
| Nov 27 | :-) | ¥16.66 | 微信 | - |
| Nov 27 | :-) | ¥16.66 | 微信 | - |
19 changes: 16 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ colors:
# SITE CUSTOMIZATION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start
# Docs: https://redefine-docs.ohevan.com/basic/global
global:
# Custom fonts
# Custom global fonts
fonts:
# Chinese fonts
chinese:
Expand All @@ -58,6 +58,11 @@ global:
enable: false # Whether to enable custom english fonts
family: # Font family
url: # Font URL to CSS file
# Custom title fonts (navbar, sidebar)
title:
enable: false # Whether to enable custom title fonts
family: # Font family
url: # Font URL to CSS file
# Content max width
content_max_width: 1000px
# Sidebar width
Expand All @@ -80,7 +85,9 @@ global:
# Whether to enable single page experience (using swup). See https://swup.js.org/. similar to pjax
single_page: true
# Whether to enable Preloader.
preloader: true
preloader:
enable: false
custom_message: # Custom message. If empty, the site title will be displayed
# Whether to enable open graph
open_graph: true
# Google Analytics
Expand Down Expand Up @@ -122,6 +129,7 @@ home_banner:
text: [] # subtitle text, array
hitokoto: # 一言配置
enable: false # Whether to enable hitokoto
show_author: false # Whether to show author
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
typing_speed: 100 # Typing speed (ms)
backing_speed: 80 # Backing speed (ms)
Expand Down Expand Up @@ -241,6 +249,8 @@ home:
# ...... # you can add more
# Article date format
article_date_format: auto # auto, relative, YYYY-MM-DD, YYYY-MM-DD HH:mm:ss etc.
# Article excerpt length
excerpt_length: 200 # Max length of article excerpt
# Article categories visibility
categories:
enable: true # Whether to enable
Expand Down Expand Up @@ -285,6 +295,9 @@ articles:
code_block:
copy: true # Whether to enable code block copy button
style: mac # mac | simple
highlight_theme: # Color scheme for highlightjs code highlighting. For preview, see https://highlightjs.org/examples
light: github # light mode theme, support: github, atom-one-light, default
dark: vs2015 # dark mode theme, support: github-dark, monokai-sublime, vs2015, night-owl, atom-one-dark, nord, tokyo-night-dark, a11y-dark, agate
font: # Custom font
enable: false # Whether to enable
family: # Font family
Expand Down Expand Up @@ -446,7 +459,7 @@ cdn:
# Whether to enable CDN
enable: false
# CDN Provider
provider: npmmirror # npmmirror, zstatic, sustech, staticfile, bootcdn, cdnjs, jsdelivr, unpkg, custom
provider: npmmirror # npmmirror, zstatic, sustech, cdnjs, jsdelivr, unpkg, custom
# Custom CDN URL
# format example: https://cdn.custom.com/hexo-theme-redefine/${version}/source/${path}
# The ${path} must leads to the root of the "source" folder of the theme
Expand Down
4 changes: 2 additions & 2 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ archive: Archive
archives: Archives
top: TOP
sticky: Sticky
go-back-home: Go Back Home


# ----------------------------------------
# Menu Translation
# ----------------------------------------
about: About
changelog: Changelog
status: Status
links: Links
link: Link
friends: Friends
Expand All @@ -50,7 +50,7 @@ site_pv: TOTAL PAGE VIEWS
read_more: Read more
wordcount: Words
min2read: Mins

status: Status

# ----------------------------------------
# Footer
Expand Down
3 changes: 2 additions & 1 deletion languages/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 网站翻译
# ----------------------------------------
search: 検索...
toc: このページの目次
toc: 目次
prev: 前のページ
next: 次のページ
prev_posts: 前一篇
Expand All @@ -24,6 +24,7 @@ comment: コメント
comments: コメント
top: トップ
sticky: 屋根
go-back-home: トップページに戻ります

# ----------------------------------------
# 菜单翻译
Expand Down
9 changes: 5 additions & 4 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ----------------------------------------
# 网站翻译
# ----------------------------------------
search: 搜索...
toc: 此页目录
search: 站内搜索您需要的内容...
toc: 目录
prev: 上一页
next: 下一页
prev_posts: 上一篇
Expand All @@ -24,6 +24,7 @@ comment: 评论
comments: 评论
top: 置顶
sticky: 置顶
go-back-home: 回到首页

# ----------------------------------------
# 菜单翻译
Expand Down Expand Up @@ -61,7 +62,7 @@ seconds: 秒

optimized_by: 并由 Evan 进行优化
rights: 版权所有
site_posts: " %s 篇文章"
site_posts: "共撰写了 %s 篇文章"
site_wordcount: "共 %s 字"

# ----------------------------------------
Expand Down Expand Up @@ -91,4 +92,4 @@ ago:

create_time: 创建
update_time: 更新
expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。"
expired: "这篇文章最后更新于 %s 天前,内容可能已经过时。"
7 changes: 4 additions & 3 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ----------------------------------------
# 网站翻译
# ----------------------------------------
search: 搜尋...
toc: 此頁目錄
search: 站內搜尋您想要的內容...
toc: 目錄
prev: 上一頁
next: 下一頁
prev_posts: 上一篇
Expand All @@ -24,6 +24,7 @@ comment: 留言
comments: 留言
top: 頂端
sticky: 置頂
go-back-home: 回到首頁

# ----------------------------------------
# 菜单翻译
Expand Down Expand Up @@ -90,4 +91,4 @@ ago:

create_time: 撰寫
update_time: 更新
expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。"
expired: "这篇文章最後更新於 %s 天前,內容可能已經過時。"
6 changes: 3 additions & 3 deletions layout/_partials/404-template.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="nf-container">
<div class="nf-text">
<h1>404 Page Not Found</h1>
<h1>404<br>Page Not Found</h1>
</div>
<div class="nf-button">
<a href="/" class="button large center"><i class="fa-regular fa-house"></i> Go Back Home</a>
<a href="/" class="button large center"><i class="fa-regular fa-house"></i> __("go-back-home")</a>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion layout/_partials/comments/gitalk.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
) { %>
<div id="gitalk-container"></div>
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>
src="//cdn.staticfile.org/gitalk/1.8.0/gitalk.min.js"></script>
src="https://cdnjs.cloudflare.com/ajax/libs/gitalk/1.8.0/gitalk.min.js"></script>
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>>
function loadGitalk() {
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/comments/twikoo.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if(theme.comment.system === 'twikoo' && theme.comment.config.twikoo.server_url) { %>
<div class="twikoo-container">
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>
src='https://cdn.staticfile.org/twikoo/<%- theme.comment.config.twikoo.version %>/twikoo.all.min.js'
src='https://cdnjs.cloudflare.com/ajax/libs/twikoo/<%- theme.comment.config.twikoo.version %>/twikoo.all.min.js'
></script>
<div id="twikoo-comment"></div>
<script <%= theme.global.single_page === true ? 'data-swup-reload-script' : '' %>>
Expand Down
14 changes: 9 additions & 5 deletions layout/_partials/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
<% const cdnLinks = {
'jsdelivr': 'https://cdn.jsdelivr.net',
'unpkg': 'https://unpkg.com',
'personal': 'https://evan.beee.top',
'aliyun': 'https://evan.beee.top',
'cdnjs': 'https://cdnjs.cloudflare.com',
'bootcdn': 'https://cdn.bootcdn.net',
'staticfile': 'https://cdn.staticfile.org'
'sustech': 'https://mirrors.sustech.edu.cn',
'zstatic': 'https://s4.zstatic.net',
'npmmirror': 'https://registry.npmmirror.com',
}; %>
<% if (cdnLinks[provider]) { %>
<link rel="preconnect" href="<%= cdnLinks[provider] %>" crossorigin>
Expand Down Expand Up @@ -110,8 +112,10 @@
<% if (theme.global.fonts.english.enable) { %>
<link href="<%- theme.global.fonts.english.url %>" rel="stylesheet">
<% } %>

<% if (theme.global.preloader) { %>
<% if (theme.global.fonts.title.enable) { %>
<link href="<%- theme.global.fonts.title.url %>" rel="stylesheet">
<% } %>
<% if (theme.global.preloader === true || theme.global.preloader.enable === true) { %>
<%- renderJS('js/libs/anime.min.js')%>
<% } %>

Expand Down
5 changes: 4 additions & 1 deletion layout/_partials/home-content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
<% } else if (post.excerpt && post.excerpt !== "false") { %>
<%- render(post.excerpt, "markdown") %>
<% } else { %>
<%- truncate(strip_html(post.content), {length: 128}) %>
<%
const excerptLength = theme.home.excerpt_length || 200;
%>
<%- truncate(strip_html(post.content), {length: excerptLength}) %>
<% } %>
</div>
Expand Down
4 changes: 3 additions & 1 deletion layout/_partials/preloader.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@

<div class="preloader">
<h2 class="ml13">
<%= theme.info.title %>
<%=
theme.global.preloader.custom_message || theme.info.title
%>
</h2>
<script>
var textWrapper = document.querySelector('.ml13');
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<%- renderJSModule('js/plugins/masonry.js') %>
<% } %>

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

Expand Down
4 changes: 2 additions & 2 deletions layout/_widgets/archive-list.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
</div>
<% let previousDate = null; %>
<ul class="article-list pl-0 md:pl-8 text-lg leading-[1.5]">
<% postYear.postList.forEach(post => { %>
<% postYear.postList.sort((a,b) => (a.date > b.date ? -1 : (a.date < b.date ? 1 : a.title.localeCompare(b.title)))).forEach(post => { %>
<% const currentDate = date(post.date, 'MM-DD'); %>
<% if (previousDate !== currentDate) { %>
<% if (previousDate) { %>
</li>
<% } %> <!-- Close the previous LI if not the first item -->
<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 %>'>
<% } %>
<a href="<%- url_for(post.path) %>" class="block overflow-hidden w-fit">
<a href="<%- url_for(post.path) %>" class="block w-fit">
<span class="article-title my-0.5 text-2xl"><%= post.title %></span>
</a>
<% previousDate = currentDate; %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_widgets/essays.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<li class="w-full flex flex-row relative">
<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>
<div class="w-full border-border-color rounded-xl rounded-tl-none redefine-box-shadow-flat overflow-hidden">
<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>
<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>
<div id="shuoshuo-content" class="px-4 py-2"><%- markdown(e.content) %></div>
</div>
<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>
Expand Down
9 changes: 8 additions & 1 deletion layout/_widgets/tagcloud.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<% if (site.tags.length){ %>
<div class="tagcloud-container">
<div>
<h1 class="tagcloud-header"><%- __('tags') %></h1>
<h1 class="tagcloud-header">
<% const useCustomTitle = page.title.toLowerCase() !== "tags" && page.title.toLowerCase() !=="tag" && page.title !=="标签" %>
<% if (useCustomTitle) { %>
<%= page.title %>
<% } else { %>
<%- __('tags') %>
<% } %>
</h1>
</div>
<% if (theme.page_templates.tags_style == 'cloud') { %>
Expand Down
Loading

0 comments on commit 0187cf4

Please sign in to comment.