Skip to content

Commit

Permalink
Merge pull request #253 from XPoet/dev
Browse files Browse the repository at this point in the history
Release new version
  • Loading branch information
XPoet authored Sep 26, 2023
2 parents 291865a + 134c99f commit ee7b36f
Show file tree
Hide file tree
Showing 70 changed files with 1,183 additions and 358 deletions.
15 changes: 12 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ post:
# Post copyright info
copyright_info: false # Option values: true | false

# Post share
share: false # Option values: true | false

# Reward author
reward:
enable: false # Option values: true | false
img_link: # Image link for the payment QR code
text: # Custom reward text, Can be null

# ---------------------------------------------------------------------------------------
# Code block
# Docs: https://keep-docs.xpoet.cn/tutorial/configuration-guide/code_block.html
Expand Down Expand Up @@ -223,9 +232,9 @@ comment:
# See: https://github.com/imaegoo/twikoo
# https://twikoo.js.org
twikoo:
env_id: # Tencent Cloud environment id
region: # Environment region. If select Guangzhou, fill in "ap-guangzhou"
version: 1.6.8 # Twikoo version, default use v1.6.8
env_id: # Environment ID
region: # Environment region, Can be null
version: 1.6.21 # Twikoo version, default use 1.6.21

# Waline
# See: https://github.com/walinejs/waline
Expand Down
7 changes: 7 additions & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ footer:
tencent_cloud: Tencent Cloud
upyun: UPYUN
total_words: Total words
post:
share:
qq: "Share to QQ"
wechat: "Share to WeChat"
weibo: "Share to WeiBo"
wechat_scan: "Scan by WeChat"
reward: Reward Author
7 changes: 7 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ footer:
tencent_cloud: 腾讯云
upyun: 又拍云
total_words: 总字数
post:
share:
qq: "分享到 QQ"
wechat: "分享到微信"
weibo: "分享到微博"
wechat_scan: "微信扫一扫"
reward: 打赏作者
7 changes: 7 additions & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ footer:
tencent_cloud: 騰訊雲
upyun: 又拍雲
total_words: 總字數
post:
share:
qq: "分享到 QQ"
wechat: "分享到微信"
weibo: "分享到微博"
wechat_scan: "微信掃壹掃"
reward: 給作者打賞
4 changes: 2 additions & 2 deletions layout/_partial/article-meta-info.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const home_tag_limit_number = theme?.home_article?.tag?.limit || 3
</span>
<% } %>
<% if ((post.categories.length && theme?.home_article?.category?.enable === true) || page_type === 'post') { %>
<% if (post.categories.length && (theme?.home_article?.category?.enable === true || page_type === 'post')) { %>
<span class="meta-info-item article-category border-box"><i class="icon fas fa-folder"></i>&nbsp;
<ul>
<% post.categories.forEach((category, i) => {
Expand All @@ -42,7 +42,7 @@ const home_tag_limit_number = theme?.home_article?.tag?.limit || 3
</span>
<% } %>
<% if ((post.tags.length && theme?.home_article?.tag?.enable === true) || page_type === 'post') { %>
<% if (post.tags.length && (theme?.home_article?.tag?.enable === true || page_type === 'post')) { %>
<span class="article-tag meta-info-item border-box">
<i class="icon fas fa-tags"></i>&nbsp;
<ul>
Expand Down
22 changes: 13 additions & 9 deletions layout/_partial/first-screen.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<%
const { description: fs_description, hitokoto: fs_hitokoto } = theme?.style?.first_screen || {}
const { description: c_description } = config
let final_description = fs_description || c_description || ''
let final_description = fs_description || ''
final_description = final_description.split('||').map(desc => desc.trim())
if (final_description.length > 2) { final_description.length = 2 }
const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
Expand All @@ -12,9 +11,15 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
<div class="middle-placeholder border-box">
<% if (final_description.length || fs_hitokoto === true) { %>
<div class="description hitokoto">
<% for (const idx in final_description) { %>
<div class="desc-item"><%= final_description[idx] %></div>
<div class="description border-box">
<% if (fs_hitokoto === true) { %>
<div class="desc-item border-box"><span class="desc hitokoto"></span><span class="cursor"></span></div>
<% } else { %>
<% for (const idx in final_description) { %>
<% if (final_description[idx]) { %>
<div class="desc-item border-box"><span class="desc"><%= final_description[idx] %></span><span class="cursor"></span></div>
<% } %>
<% } %>
<% } %>
</div>
<% } %>
Expand Down Expand Up @@ -42,9 +47,9 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
}
%>
<div class="tooltip sc-icon-item <%= isImg ? 'tooltip-img clear' : ''%>"
data-content="<%= __(key) %>"
data-name="<%= key %>"
<%= isImg ? 'data-img-url='+ link +'' : '' %>
data-tooltip-content="<%= __(key) %>"
data-tooltip-img-name="<%= key %>"
<%= isImg ? 'data-tooltip-img-url='+ link +'' : '' %>
>
<% if(key === 'email') { %>
<a href="mailto:<%- link %>">
Expand All @@ -65,6 +70,5 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
</div>
<% } %>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const web_master = bi_author || hexo_author
<% } %>
<%- __(
'footer.deploy',
'<span class="tooltip" data-content="' + __('footer.deploy_provider.' + f_site_deploy?.provider) + '"><img src="/images/deploy-provider/' + f_site_deploy?.provider + '.png"></span>'
'<span class="tooltip" data-tooltip-content="' + __('footer.deploy_provider.' + f_site_deploy?.provider) + '"><img src="/images/deploy-provider/' + f_site_deploy?.provider + '.png"></span>'
) %>
<% if (f_site_deploy?.url) { %>
</a>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/friends-link.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul class="friends-link-list border-box">
<% for (const f of theme?.links) { %>
<% if (f?.title) { %>
<li class="link-type-title text-ellipsis"><i class="fa-solid fa-users"></i>&nbsp;<%= f?.title %></li>
<li class="link-type-title text-ellipsis border-box"><%= f.title %></li>
<% } else { %>
<li class="friends-link-item border-box">
<a class="a-wrap border-box" href="<%= f?.link %>">
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
<% } %>
<% }) %>
<% } %>
<%- exportConfig() %>
<%- exportThemeConfig() %>
</head>
10 changes: 5 additions & 5 deletions layout/_partial/pjax/pjax.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
analytics: false,
currentUrlFullReload: false,
scrollRestoration: false,
// scrollTo: true,
scrollTo: true,
});
document.addEventListener('pjax:send', () => {
KEEP.utils.pjaxProgressBarStart();
KEEP.utils.pjaxProgressBarStart()
});
document.addEventListener('pjax:complete', () => {
KEEP.utils.pjaxProgressBarEnd();
window.pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
KEEP.refresh();
KEEP.utils.pjaxProgressBarEnd()
window.pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'))
KEEP.initExecute()
});
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="type">
<%- __('copyright.license') %>
</div>
<div class="content tooltip" data-content="CC BY-NC-SA 4.0">
<div class="content tooltip" data-tooltip-content="CC BY-NC-SA 4.0">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">
<i class="fa-brands fa-creative-commons"></i>
<i class="fa-brands fa-creative-commons-by"></i>
Expand All @@ -43,7 +43,7 @@
<i class="copyright-bg fa-solid fa-copyright"></i>
</div>
<div class="copy-copyright-info flex-center tooltip" data-content="<%= __('copy_copyright.copy') %>" data-offset-y="-2px">
<div class="copy-copyright-info flex-center tooltip" data-tooltip-content="<%= __('copy_copyright.copy') %>" data-tooltip-offset-y="-2px">
<i class="fa-solid fa-copy"></i>
</div>
</div>
21 changes: 21 additions & 0 deletions layout/_partial/post/post-share.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="post-share-container border-box">
<ul class="share-list-wrap border-box">
<li class="qq share-item border-box flex-center tooltip"
data-tooltip-content="<%= __('post.share.qq') %>"
>
<i class="fa-brands fa-qq"></i>
</li>
<li class="wechat share-item border-box flex-center tooltip tooltip-img"
data-tooltip-content="<%= __('post.share.wechat') %>"
data-tooltip-img-tip="<%= __('post.share.wechat_scan') %>"
data-tooltip-img-style="background-color: #fff; top: -10px; padding: 0.6rem 0.6rem 0.1rem 0.6rem;"
>
<i class="fa-brands fa-weixin"></i>
</li>
<li class="weibo share-item border-box flex-center tooltip"
data-tooltip-content="<%= __('post.share.weibo') %>"
>
<i class="fa-brands fa-weibo"></i>
</li>
</ul>
</div>
File renamed without changes.
10 changes: 10 additions & 0 deletions layout/_partial/post/reward-author.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="reward-author-container border-box flex-center">
<button class="keep-button border-box flex-center reward-btn tooltip tooltip-img"
data-tooltip-content="<%= theme?.post?.reward?.text || __('post.reward') %>"
data-tooltip-img-url="<%= theme?.post?.reward?.img_link %>"
data-tooltip-img-trigger="click"
data-tooltip-img-style="top: -8px;"
>
<i class="fa-solid fa-hand-holding-heart"></i>
</button>
</div>
56 changes: 32 additions & 24 deletions layout/_partial/scripts.ejs
Original file line number Diff line number Diff line change
@@ -1,53 +1,61 @@
<!-- common -->
<%- __js([
'js/utils.js',
'js/main.js',
'js/header-shrink.js',
'js/back2top.js',
'js/dark-light-toggle.js'
'js/dark-light-toggle.js',
'js/main.js',
'js/libs/anime.min.js'
]) %>

<%
const {
local_search: t_local_search,
code_copy: t_code_copy,
code_block: t_code_block,
lazyload: t_lazyload,
toc: t_toc,
pjax: t_pjax,
comment: t_comment
} = theme
%>

<% if (t_local_search?.enable === true) { %>
<!-- local-search -->
<% if (theme?.local_search?.enable === true) { %>
<%- __js('js/local-search.js') %>
<% } %>
<% if (t_code_copy?.enable === true || t_code_block?.enable === true || t_code_block?.tools?.enable === true) { %>
<!-- code-block -->
<% if (theme?.code_block?.tools?.enable === true) { %>
<%- __js('js/code-block.js') %>
<% } %>
<% if (t_lazyload?.enable === true) { %>
<!-- lazyload -->
<% if (theme?.lazyload?.enable === true) { %>
<%- __js('js/lazyload.js') %>
<% } %>
<div class="post-scripts<%= theme?.pjax?.enable === true ? ' pjax' : '' %>">
<div class="<%= theme?.pjax?.enable === true ? 'pjax' : '' %>">
<% if (is_post()) { %>
<%- __js('js/post-helper.js') %>
<% if (t_toc?.enable === true || t_comment?.enable === true) { %>
<%- __js('js/libs/anime.min.js') %>
<!-- post-helper -->
<%- __js('js/post/post-helper.js') %>
<!-- toc -->
<% if (theme?.toc?.enable === true) { %>
<%- __js('js/post/toc.js') %>
<% } %>
<!-- copyright-info -->
<% if (theme?.post?.copyright_info === true) { %>
<%- __js('js/post/copyright-info.js') %>
<% } %>
<% if (t_toc?.enable === true) { %>
<%- __js('js/toc.js') %>
<!-- share -->
<% if (theme?.post?.share === true) { %>
<%- __js('js/post/share.js') %>
<% } %>
<% } %>
<!-- category-page -->
<% if (isCategoriesPage(page.path) === true) { %>
<%- __js('js/category-page.js') %>
<% } %>
<!-- links-page -->
<% if (isLinksPage(page.path) === true) { %>
<%- __js('js/links-page.js') %>
<% } %>
</div>
<% if (t_pjax?.enable === true) { %>
<!-- pjax -->
<% if (theme?.pjax?.enable === true) { %>
<%- partial('pjax/pjax') %>
<% } %>
16 changes: 4 additions & 12 deletions layout/_partial/side-tools.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
</li>
<% } %>
<% if (theme?.style?.scroll?.percent !== true) { %>
<li class="tools-item tool-scroll-to-top flex-center">
<i class="fas fa-arrow-up"></i>
</li>
<% } %>
<li class="tools-item tool-scroll-to-bottom flex-center">
<i class="fas fa-arrow-down"></i>
</li>
Expand All @@ -52,11 +46,9 @@
<i class="fas fa-cog fa-spin"></i>
</li>
<% if (theme?.style?.scroll?.percent === true) { %>
<li class="tools-item tool-scroll-to-top flex-center">
<i class="arrow-up fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
<% } %>
<li class="tools-item tool-scroll-to-top flex-center show-arrow">
<i class="arrow fas fa-arrow-up"></i>
<span class="percent"></span>
</li>
</ul>
</div>
4 changes: 1 addition & 3 deletions layout/_partial/tagcloud.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
<%- partial('_partial/common/empty-content') %>
<% } %>
<% if (page?.comment === true) { %>
<div class="tagcloud-comments">
<%- partial('_partial/comment/comment') %>
</div>
<%- partial('_partial/comment/comment') %>
<% } %>
</div>
</div>
Loading

0 comments on commit ee7b36f

Please sign in to comment.