Skip to content

Commit

Permalink
Merge pull request #324 from XPoet/dev
Browse files Browse the repository at this point in the history
Release new version
  • Loading branch information
XPoet authored May 15, 2024
2 parents ab9ebd7 + 1c2895b commit 117dda4
Show file tree
Hide file tree
Showing 36 changed files with 354 additions and 368 deletions.
4 changes: 2 additions & 2 deletions .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.0` or later. (使用 Keep `4.1.0` 或更高版本)
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
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 All @@ -31,7 +31,7 @@ body:
id: expected-behavior
attributes:
label: Expected behavior | 预期行为
description: |
description: |
Please provide a detailed description of what you consider expected behavior.
请仔细描述你认为的预期行为
validations:
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.0` or later. (使用 Keep `4.1.0` 或更高版本)
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
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.0` or later. (使用 Keep `4.1.0` 或更高版本)
- label: I am using Keep version `4.1.2` or later. (使用 Keep `4.1.2` 或更高版本)
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
26 changes: 9 additions & 17 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ comment:
waline:
server_url: # Server URL
reaction: false # Post reactions, Option values: true | false
version: 2 # Waline version, default use v2
version: 3 # Waline version, default use v3

# Giscus
# See: https://github.com/giscus/giscus
Expand Down Expand Up @@ -309,30 +309,22 @@ pjax:
# Docs: https://keep-docs.xpoet.cn/basis/configuration-guide/footer.html
# ---------------------------------------------------------------------------------------
footer:
since: 2020 # The starting year of your website, Can be null
word_count: false # Option values: true | false

icp:
enable: false # Option values: true | false
record_code: # ICP record code of your website
url: https://beian.miit.gov.cn # Your ICP link url, Can be null
since: 2020 # The starting year of your website, Can be null
word_count: false # Option values: true | false

site_deploy:
enable: false # Option values: true | false
provider: github # Option values: github | vercel | netlify | cloudflare | gitee | aliyun | tencent_cloud | upyun
url: # Your deployment provider url, Can be null

# When the footer style is shields, you can customize the shields configuration
# See: https://shields.io
shields_style:
record:
enable: false # Option values: true | false
custom:
- link_url: # Your link url, Can be null
img_url: # Shields image url
list:
- code: # record code of your website
link: # record link of your website, Can be null
# e.g.
# - link_url: https://github.com/XPoet/hexo-theme-keep
# img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.3-blue?style=flat-square&logo=hexo
# - ...
# - code: ICP 001
# - link: https://beian.miit.gov.cn


# ---------------------------------------------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="fade-in-down-animation">
<div class="category-container border-box">
<div class="category-archive-container border-box">
<div class="category-name">
<i class="fas fa-folder"></i>&nbsp;<%= page.category %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion layout/category-list.ejs → layout/_page/category.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="fade-in-down-animation">
<div class="category-list-container">
<div class="category-page-container">
<% if (site.categories.length > 0) { %>
<div class="category-list-content">
<%- list_categories(site.categories, {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion layout/tag-content.ejs → layout/_page/tag-archive.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="fade-in-down-animation">
<div class="tag-container border-box">
<div class="tag-archive-container border-box">
<div class="tag-name"><i class="fas fa-hashtag"></i>&nbsp;<%= page.tag %>
</div>
<div class="tag-post-list">
Expand Down
25 changes: 25 additions & 0 deletions layout/_page/tag.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="fade-in-down-animation">
<div class="tag-page-container">
<% if (site.tags.length){ %>
<% if (page?.tag_cloud === false){ %>
<div class="tag-list-content">
<%- list_tags() %>
</div>
<% } else { %>
<div class="tagcloud-content">
<%- tagcloud({
min_font: 1,
max_font: 1.6,
unit: 'rem',
amount: 100
}) %>
</div>
<% } %>
<% } else { %>
<%- partial('_partial/common/empty-content') %>
<% } %>
<% if (page?.comment === true) { %>
<%- partial('_partial/comment/comment') %>
<% } %>
</div>
</div>
102 changes: 70 additions & 32 deletions layout/_partial/comment/plugins/waline.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ let {
reaction: waline_reaction,
options: waline_options = {}
} = theme?.comment?.waline || {}
if (!waline_version) { waline_version = '2' }
waline_version = String(waline_version).trim()
if (!waline_version) { waline_version = '3' }
const esm_load = waline_version === '3' || /^3\..*/.test(waline_version)
let cdn_css = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline.css`
let cdn_css_meta = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline-meta.css`
let cdn_js = `//cdn.jsdelivr.net/npm/@waline/client@v${waline_version}/dist/waline.js`
const { enable: t_cdn_enable, provider: t_cdn_provider } = theme?.cdn || {}
if (t_cdn_enable === true) {
Expand All @@ -33,40 +40,71 @@ if (t_cdn_enable === true) {
<link rel="stylesheet" href="<%= cdn_css %>"/>
<link rel="stylesheet" href="<%= cdn_css_meta %>"/>
<div id="waline-comment"></div>
<script <%= pjax_enable === true ? 'data-pjax' : '' %>
src="<%= cdn_js %>"
async
onerror="window.KeepCommentPlugin.loadFailHandle()"
></script>
<script <%= pjax_enable === true ? 'data-pjax' : '' %>
async
>
<script data-pjax>
window.KeepCommentPlugin.walineOptions = JSON.parse('<%= JSON.stringify(waline_options) %>'.replace(/&#34;/g, '"'))
window.KeepCommentPlugin.walineOptions.el = '#waline-comment'
window.KeepCommentPlugin.walineOptions.comment = '.post-comments-count'
window.KeepCommentPlugin.walineOptions.serverURL = '<%= waline_env_server_url %>'
window.KeepCommentPlugin.walineOptions.lang = '<%= config.language %>' || 'zh-CN'
window.KeepCommentPlugin.walineOptions.reaction = '<%= waline_reaction %>' === 'true'
</script>
window.KeepCommentPlugin.initWaline = () => {
if (window?.Waline) {
window.KeepCommentPlugin.walineOptions.el = '#waline-comment'
window.KeepCommentPlugin.walineOptions.comment = '.post-comments-count'
window.KeepCommentPlugin.walineOptions.serverURL = '<%= waline_env_server_url %>'
window.KeepCommentPlugin.walineOptions.lang = '<%= config.language %>' || 'zh-CN'
window.KeepCommentPlugin.walineOptions.reaction = '<%= waline_reaction %>' === 'true'
window.Waline.init(window.KeepCommentPlugin.walineOptions)
window.KeepCommentPlugin.hideLoading()
} else {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1000)
}
}
<% if (!esm_load) { %>
<script <%= pjax_enable === true ? 'data-pjax' : '' %>
src="<%= cdn_js %>"
async
onerror="window.KeepCommentPlugin.loadFailHandle()"
></script>
<script <%= pjax_enable === true ? 'data-pjax' : '' %>
async
>
window.KeepCommentPlugin.initWaline = () => {
if (window?.Waline) {
window.Waline.init(window.KeepCommentPlugin.walineOptions)
window.KeepCommentPlugin.hideLoading()
} else {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1000)
}
}
if ('<%= pjax_enable %>' === 'true') {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1200)
} else {
window.addEventListener('DOMContentLoaded', window.KeepCommentPlugin.initWaline)
}
</script>
if ('<%= pjax_enable %>' === 'true') {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1200)
} else {
window.addEventListener('DOMContentLoaded', window.KeepCommentPlugin.initWaline)
}
</script>
<% } %>
<% if (esm_load) { %>
<script <%= pjax_enable === true ? 'data-pjax' : '' %>
async
type="module"
>
import { init } from '<%= cdn_js %>'
window.KeepCommentPlugin.initWaline = () => {
if (init) {
init(window.KeepCommentPlugin.walineOptions)
window.KeepCommentPlugin.hideLoading()
} else {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1000)
}
}
if ('<%= pjax_enable %>' === 'true') {
setTimeout(() => {
window.KeepCommentPlugin.initWaline()
}, 1200)
} else {
window.addEventListener('DOMContentLoaded', window.KeepCommentPlugin.initWaline)
}
</script>
<% } %>
</div>
<% } else { %>
<%- partial('../config-error', { comment_plugin: 'Waline' }) %>
Expand Down
Loading

0 comments on commit 117dda4

Please sign in to comment.