Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release new version #328

Merged
merged 8 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
- label: I am using Keep version `4.1.3` or later. (使用 Keep `4.1.3` 或更高版本)
required: true
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
- label: I am using Keep version `4.1.3` or later. (使用 Keep `4.1.3` 或更高版本)
required: true
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
- label: I am using Keep version `4.1.3` or later. (使用 Keep `4.1.3` 或更高版本)
required: true
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
required: true
Expand Down
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ comment:
twikoo:
env_id: # Environment ID
region: # Environment region, Can be null
version: 1.6.21 # Twikoo version, default use 1.6.21
version: 1.6.36 # Twikoo version, default use v1.6.36

# Waline
# See: https://github.com/walinejs/waline
# https://waline.js.org/guide/get-started.html
waline:
server_url: # Server URL
reaction: false # Post reactions, Option values: true | false
version: 3 # Waline version, default use v3
server_url: # Server URL
reaction: false # Post reactions, option values: true | false
version: 3.2.1 # Waline version, default use v3.2.1

# Giscus
# See: https://github.com/giscus/giscus
Expand Down
3 changes: 2 additions & 1 deletion layout/_page/post.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%
const post_author = page?.author || theme?.base_info?.author || config?.author
const post_avatar = page?.avatar || theme?.base_info?.avatar
const is_code_block_unshrink = page?.code_block_shrink === false
%>
<div class="fade-in-down-animation">
<div class="post-page-container border-box">
Expand Down Expand Up @@ -50,7 +51,7 @@ const post_avatar = page?.avatar || theme?.base_info?.avatar
</div>
<% } %>

<div class="post-content keep-markdown-body">
<div class="post-content keep-markdown-body <%= is_code_block_unshrink ? 'code-block-unshrink' : '' %>">
<% if (page?.aging === true) { %>
<div class="post-aging-tips"
data-update-date="<%= page.updated %>"
Expand Down
1 change: 1 addition & 0 deletions layout/_partial/archive-list.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ul class="archive-item-body border-box">
<% postItem.postList.forEach(post => { %>
<li class="post-item border-box">
<span class="starting-point border-box flex-center"></span>
<span class="post-date border-box"><%= date(post.date, 'MM-DD') %></span>
<a class="post-title border-box text-ellipsis"
href="<%- url_for(post.path) %>"
Expand Down
9 changes: 8 additions & 1 deletion layout/_partial/comment/plugins/twikoo.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let {
region: tk_region,
version: tk_version
} = theme?.comment?.twikoo || {}
if (!tk_version) { tk_version = '1.6.7' }
if (!tk_version) { tk_version = '1.6.36' }
let twikoo_cdn_url = `//cdn.jsdelivr.net/npm/twikoo@${tk_version}/dist/twikoo.all.min.js`
const { enable: t_cdn_enable, provider: t_cdn_provider } = theme?.cdn || {}

Expand All @@ -18,6 +18,13 @@ if (t_cdn_enable === true) {
case 'unpkg':
twikoo_cdn_url = `//unpkg.com/twikoo@${tk_version}/dist/twikoo.all.min.js`
break

case 'cdnjs':
if (!(/^(\d+)\.(\d+)\.(\d+)$/.test(tk_version))) {
tk_version = '1.6.36'
}
twikoo_cdn_url = `https://cdnjs.cloudflare.com/ajax/libs/twikoo/${tk_version}/twikoo.all.min.js`
break
}
}
%>
Expand Down
9 changes: 9 additions & 0 deletions layout/_partial/comment/plugins/waline.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ if (t_cdn_enable === true) {
cdn_css_meta = `//unpkg.com/@waline/client@v${waline_version}/dist/waline-meta.css`
cdn_js = `//unpkg.com/@waline/client@v${waline_version}/dist/waline.js`
break

case 'cdnjs':
if (!(/^(\d+)\.(\d+)\.(\d+)$/.test(waline_version))) {
waline_version = '3.2.1'
}
cdn_css = `https://cdnjs.cloudflare.com/ajax/libs/waline/${waline_version}/waline.css`
cdn_css_meta = `https://cdnjs.cloudflare.com/ajax/libs/waline/${waline_version}/waline-meta.css`
cdn_js = `https://cdnjs.cloudflare.com/ajax/libs/waline/${waline_version}/waline.js`
break
}
}
%>
Expand Down
47 changes: 28 additions & 19 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@
const {
since: f_since,
record: f_record,
site_deploy: f_site_deploy
site_deploy: f_site_deploy,
word_count: f_word_count
} = theme?.footer || {}
const { author: bi_author } = theme?.base_info || {}
const { author: hexo_author } = config
const { site_uv: bsz_site_uv, site_pv: bsz_site_pv, enable: bsz_enable } = theme?.website_count?.busuanzi_count || {}
const web_master = bi_author || hexo_author

const show_pv = bsz_enable === true && bsz_site_pv === true
const show_uv = bsz_enable === true && bsz_site_uv === true

let f_temp_total_word = 0
try {
f_temp_total_word = totalcount(site)
} catch {
f_temp_total_word = 0
}
const show_word_count = f_word_count === true && f_temp_total_word !== 0

const has_count_info = show_pv || show_uv || show_word_count
%>
<footer class="footer border-box">
<div class="copyright-info info-item">
Expand Down Expand Up @@ -37,35 +51,30 @@ const web_master = bi_author || hexo_author
</div>
<% } %>

<div class="count-info info-item">
<%
let f_temp_total_word;
try {
f_temp_total_word = totalcount(site);
} catch (e) {
f_temp_total_word = 0;
}
if (theme.footer?.word_count === true && f_temp_total_word !== 0) { %>
<span class="count-item border-box word">
<% if (has_count_info) { %>
<div class="count-info info-item">
<% if (show_word_count) { %>
<span class="count-item border-box word">
<span class="item-type border-box"><%- __('footer.total_words') %></span>
<span class="item-value border-box word"><%= totalcount(site) %></span>
</span>
<% } %>
<% } %>

<% if (bsz_enable === true && bsz_site_uv === true) { %>
<span class="count-item border-box uv">
<% if (show_uv) { %>
<span class="count-item border-box uv">
<span class="item-type border-box"><%- __('footer.site_uv') %></span>
<span class="item-value border-box uv" id="busuanzi_value_site_uv"></span>
</span>
<% } %>
<% } %>

<% if (bsz_enable === true && bsz_site_pv === true) { %>
<span class="count-item border-box pv">
<% if (show_pv) { %>
<span class="count-item border-box pv">
<span class="item-type border-box"><%- __('footer.site_pv') %></span>
<span class="item-value border-box pv" id="busuanzi_value_site_pv"></span>
</span>
<% } %>
</div>
<% } %>
</div>
<% } %>

<% if (f_record?.enable === true) { %>
<div class="record-info info-item">
Expand Down
8 changes: 7 additions & 1 deletion layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
const { title: bi_title, logo: bi_logo } = theme?.base_info || {}
const { enable: s_fs_enable } = theme?.first_screen || {}
const { enable: local_search_enable } = theme?.local_search || {}
const h_menu_nav_object = theme?.menu || { archives: '/archives' }
const origin_h_menu_nav_object = theme?.menu || { archives: '/archives' }

const h_menu_nav_object = {}
for (const key in origin_h_menu_nav_object) {
const temp_key = key.trim().toLowerCase()
h_menu_nav_object[temp_key] = origin_h_menu_nav_object[key]
}
%>
<header class="header-wrapper<%= s_fs_enable === true && is_home() ? ' transparent-1' : '' %>">

Expand Down
12 changes: 12 additions & 0 deletions source/css/layout/_page/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ $spacer-padding = 2rem
text-align justify
word-wrap break-word

&.code-block-unshrink {
figure.highlight {
height auto !important
overflow auto !important

.shrink-line {
display none !important
}
}
}


+keep-tablet() {
margin-top calc(var(--component-gap) * 0.6)
padding-bottom calc(var(--component-gap) * 0.6)
Expand Down
56 changes: 40 additions & 16 deletions source/css/layout/_partial/archive-list.styl
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,60 @@ $timeline-circle-width = 0.6rem
align-items center
justify-content space-between
width 100%
padding ($post-item-padding * 0.68) 0 ($post-item-padding * 0.68) $post-item-padding
padding ($post-item-padding * 0.8) 0 ($post-item-padding * 0.8) $post-item-padding * 1.6
font-size 1rem
border-left 1px dashed var(--border-color)

&::before {
.starting-point {
position absolute
top 50%
left -($timeline-circle-width * 0.5)
z-index $z-index-1
box-sizing border-box
width $timeline-circle-width
height $timeline-circle-width
background var(--text-color-5)
border-radius 50%
transform translateY(-50%)
content ''
}
top 0
left 0
width 1rem
height 100%


&::after {
position absolute
top 0
left 50%
z-index $z-index-1
box-sizing border-box
width 0
height 100%
border-left 1px dashed var(--text-color-5)
transform translateX(-50%)
content ''
}


&:hover {
&::before {
background var(--text-color-4)
top 50%
left 0
z-index $z-index-2
box-sizing border-box
width $timeline-circle-width * 0.8
height $timeline-circle-width * 2
background var(--text-color-5)
border-radius 0.2rem
content ''
transition-t("height", "0", "0.2", "ease")
}
}


&:hover {
.starting-point {
&::before {
height $timeline-circle-width * 2.4
background var(--text-color-4)
}
}

a.post-title {
color var(--primary-color)
}
}


.post-date {
width $post-date-width
margin-right $post-item-padding
Expand Down
12 changes: 12 additions & 0 deletions source/js/toggle-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ KEEP.initModeToggle = () => {
},

initModeStatus() {
const configMode = KEEP.theme_config?.base_info?.mode

if (configMode === 'dark') {
this.enableDarkMode()
return
}

if (configMode === 'light') {
this.enableLightMode()
return
}

const styleStatus = KEEP.getStyleStatus()

if (styleStatus) {
Expand Down
Loading