Skip to content

Commit

Permalink
Merge pull request #308 from XPoet/dev
Browse files Browse the repository at this point in the history
Release new version
  • Loading branch information
XPoet authored Mar 12, 2024
2 parents 1d449fa + 29b6182 commit 7017dc4
Show file tree
Hide file tree
Showing 43 changed files with 981 additions and 425 deletions.
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.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
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.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
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.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
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
34 changes: 20 additions & 14 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ base_info:
# ---------------------------------------------------------------------------------------
# Docs: https://keep-docs.xpoet.cn/basis/configuration-guide/menu.html
# ---------------------------------------------------------------------------------------
# If you want to enable Categories and Tags, you need to create categories and tags pages
# e.g. `hexo new page categories` or `hexo new page tags`
# If you want to enable a new navigation menu, you need to create a corresponding page
# e.g. to enable categories, you need to execute `hexo new page categories`
# Use `||` to set icon for navigation menu, e.g. `home: / || fa-solid fa-home`
menu:
Archives: /archives
# Tags: /tags
# Categories: /categories
# Links: /links
# About: /about
# Changelog: /changelog
# Photos: /photos
home: / # || fa-solid fa-home
archives: /archives # || fa-solid fa-box-archive
# tags: /tags # || fa-solid fa-tags
# categories: /categories # || fa-solid fa-layer-group
# links: /links # || fa-solid fa-link
# photos: /photos # || fa-solid fa-image
# tools: /tools # || fa-solid fa-tools
# about: /about # || fa-solid fa-user-graduate
# ......


Expand Down Expand Up @@ -79,6 +81,7 @@ social_contact:
weibo: # WeiBo
zhihu: # ZhiHu
twitter: # Twitter
x: # X
facebook: # Facebook
email: # Email

Expand All @@ -101,14 +104,17 @@ scroll:
# Docs: https://keep-docs.xpoet.cn/basis/configuration-guide/home.html
# ---------------------------------------------------------------------------------------
home:
# Website announcement in home page
announcement:

# Show category in home page post block
category: false # Option values: true | false
category: false # Option values: true | false

# Show tags in home page post block
tag: false # Option values: true | false
tag: false # Option values: true | false

# Website announcement in home page
announcement:
# Set the datetime type of home page post block
post_datetime: updated # Option values: updated | created


# ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -260,7 +266,7 @@ comment:
# See: https://github.com/ArtalkJS/Artalk
# https://artalk.js.org
artalk:
server: # Server URL
server: # Server URL

# Disqus
# See: https://disqus.com/
Expand Down
3 changes: 3 additions & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ links: Links
link: Link
photos: Photos
photo: Photo
tool: Tool
tools: Tools
search: Search...
prev: Prev
next: Next
Expand All @@ -41,6 +43,7 @@ alipay: Alipay
weibo: Weibo
zhihu: Zhihu
twitter: Twitter
x: X
facebook: Facebook
email: Email
code_block:
Expand Down
3 changes: 3 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ links: 友链
link: 友链
photos: 相册
photo: 照片
tool: 工具
tools: 工具
search: 搜索...
prev: 上一页
next: 下一页
Expand All @@ -41,6 +43,7 @@ alipay: 支付宝
weibo: 微博
zhihu: 知乎
twitter: 推特
x: X
facebook: Facebook
email: Email
code_block:
Expand Down
3 changes: 3 additions & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ links: 友鏈
link: 友鏈
photos: 相簿
photo: 照片
tool: 工具
tools: 工具
search: 搜尋...
prev: 上一頁
next: 下一頁
Expand All @@ -41,6 +43,7 @@ alipay: 支付寶
weibo: 微博
zhihu: 知乎
twitter: Twitter
x: X
facebook: Facebook
email: Email
code_block:
Expand Down
16 changes: 9 additions & 7 deletions layout/_partial/first-screen.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
<i class="fas fa-envelope"></i>
</a>
<% } else { %>
<% const sc_icon = key === 'x' ? 'x-twitter' : key %>
<% if(isImg) { %>
<i class="fab fa-<%= key %>"></i>
<i class="fab fa-<%= sc_icon %>"></i>
<% } else { %>
<a target="_blank" href="<%- link %>">
<i class="fab fa-<%= key %>"></i>
<i class="fab fa-<%= sc_icon %>"></i>
</a>
<% } %>
<% } %>
Expand All @@ -70,13 +71,14 @@ const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
<% } %>
<!-- custom svg icons -->
<% for (const icon in theme?.icons) { %>
<% if(theme.icons[icon]) { %>
<% const custom_icons = theme.source_data?.icons || {} %>
<% for (const icon in custom_icons) { %>
<% if(custom_icons[icon]) { %>
<%
const custom_tmpl = theme.icons[icon].link.split('|').map(x => x.trim())
const custom_tmpl = custom_icons[icon].link.split('|').map(x => x.trim())
let custom_is_img = false
let custom_link = theme.icons[icon].link
const custom_svg = theme.icons[icon].svg
let custom_link = custom_icons[icon].link
const custom_svg = custom_icons[icon].svg
if (custom_tmpl.length > 1) {
custom_link = custom_tmpl[1]
custom_is_img = custom_tmpl[0] === 'img'
Expand Down
39 changes: 20 additions & 19 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
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' }
delete h_menu_nav_object['home']
delete h_menu_nav_object['Home']
delete h_menu_nav_object['HOME']
const h_menu_nav_object = theme?.menu || { archives: '/archives' }
%>
<header class="header-wrapper<%= s_fs_enable === true && is_home() ? ' transparent-1' : '' %>">
Expand All @@ -24,16 +21,21 @@ delete h_menu_nav_object['HOME']
<div class="right border-box">
<div class="pc">
<ul class="menu-list">
<li class="menu-item">
<a class="<%- is_home() ? 'active' : '' %>"
href="<%- url_for('/') %>"
><%= __('home').toUpperCase() %></a>
</li>
<% for (const i in h_menu_nav_object) { %>
<%
const temp_menu_list = h_menu_nav_object[i]?.split('||')
const nav_path = temp_menu_list[0]?.trim()?.toLowerCase()
const nav_icon = temp_menu_list[1]?.trim()?.toLowerCase()
%>
<li class="menu-item">
<a class="<%- is_current(h_menu_nav_object[i]) ? 'active' : '' %>"
href="<%- url_for(h_menu_nav_object[i]) %>"
><%= __(i.toLowerCase()).toUpperCase() %></a>
<a class="<%- is_current(nav_path) ? 'active' : '' %>"
href="<%- url_for(nav_path) %>"
>
<% if (nav_icon) { %>
<i class="menu-icon <%= nav_icon %>"></i>
<% } %>
<%= __(i.toLowerCase()).toUpperCase() %>
</a>
</li>
<% } %>
<% if (local_search_enable === true) { %>
Expand All @@ -56,15 +58,14 @@ delete h_menu_nav_object['HOME']
<div class="header-drawer">
<ul class="drawer-menu-list">
<li class="drawer-menu-item flex-center">
<a class="<%- is_home() ? 'active' : '' %>"
href="<%- url_for('/') %>"
><%= __('home').toUpperCase() %></a>
</li>
<% for (let i in h_menu_nav_object) { %>
<%
const temp_menu_list2 = h_menu_nav_object[i]?.split('||')
const nav_path2 = temp_menu_list2[0]?.trim()?.toLowerCase()
%>
<li class="drawer-menu-item flex-center">
<a class="<%- is_current(h_menu_nav_object[i]) ? 'active' : '' %>"
href="<%- url_for(h_menu_nav_object[i]) %>"
<a class="<%- is_current(nav_path2) ? 'active' : '' %>"
href="<%- url_for(nav_path2) %>"
><%= __(i.toLowerCase()).toUpperCase() %></a>
</li>
<% } %>
Expand Down
30 changes: 16 additions & 14 deletions layout/_partial/post/post-copyright-info.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<%
let licenseLang = ''
let license_lang = ''
if (config?.language === 'zh-CN') { license_lang = '.zh-hans' }
if (config?.language === 'zh-TW') { license_lang = '.zh-hant' }
let license_url = 'https://creativecommons.org/licenses/by-nc-sa/4.0/deed' + license_lang
if (config?.language === 'zh-CN') {
licenseLang = '.zh-hans'
}
if (config?.language === 'zh-TW') {
licenseLang = '.zh-hant'
}
const use_custom = theme?.post?.copyright_info !== true && theme?.post?.copyright_info?.custom_license && theme?.post?.copyright_info?.custom_link
if (use_custom) { license_url = theme?.post?.copyright_info?.custom_link }
%>
<div class="post-copyright-info-container border-box">
<div class="copyright-info-content border-box">
Expand Down Expand Up @@ -41,12 +39,16 @@ if (config?.language === 'zh-TW') {
<div class="type">
<%- __('copyright.license') %>
</div>
<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<%= licenseLang %>">
<i class="fa-brands fa-creative-commons"></i>
<i class="fa-brands fa-creative-commons-by"></i>
<i class="fa-brands fa-creative-commons-nc"></i>
<i class="fa-brands fa-creative-commons-sa"></i>
<div class="content tooltip" data-tooltip-content="<%= use_custom ? '' : 'CC BY-NC-SA 4.0' %>">
<a href="<%= license_url %>" target="_blank">
<% if (use_custom) { %>
<%= theme?.post?.copyright_info?.custom_license %>
<% } else { %>
<i class="fa-brands fa-creative-commons"></i>
<i class="fa-brands fa-creative-commons-by"></i>
<i class="fa-brands fa-creative-commons-nc"></i>
<i class="fa-brands fa-creative-commons-sa"></i>
<% } %>
</a>
</div>
</div>
Expand Down
27 changes: 22 additions & 5 deletions layout/_partial/post/post-meta-info.ejs
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
<%
const home_category_limit_number = 3
const home_tag_limit_number = 5
const show_home_post_block_datetime = theme.home.hasOwnProperty('post_datetime') ? !!theme.home.post_datetime : true
const home_post_datetime_value = (theme.home.hasOwnProperty('post_datetime') ? theme.home?.post_datetime : 'updated') || 'updated'
const home_post_datetime_format = (theme.home.hasOwnProperty('post_datetime_format') ? theme.home?.post_datetime_format : 'ago') || 'ago'
const home_post_datetime_split_list = home_post_datetime_value?.split('||')
const home_post_datetime_type = home_post_datetime_split_list[0]?.trim()?.toLowerCase()
const home_post_datetime_icon = home_post_datetime_split_list[1]?.trim()?.toLowerCase()
const home_post_datetime_created_icon = home_post_datetime_icon || 'fa-solid fa-file-circle-plus'
const home_post_datetime_updated_icon = home_post_datetime_icon || 'fa-solid fa-history'
const home_post_block_datetime_icon = home_post_datetime_type === 'created' ? home_post_datetime_created_icon : home_post_datetime_updated_icon
const home_post_block_datetime = home_post_datetime_type === 'created' ? post.date : post.updated
const { created_datetime_icon, updated_datetime_icon } = theme?.post || {}
%>
<div class="post-meta-info-container border-box <%= page_type %>">
<div class="post-meta-info border-box">
<% if (page_type === 'home') { %>
<% if (page_type === 'home' && show_home_post_block_datetime) { %>
<span class="meta-info-item border-box">
<i class="icon fas fa-history"></i>&nbsp;<span class="home-post-history" data-updated="<%= post.updated %>"><%= date(post.updated, 'YYYY-MM-DD HH:mm:ss') %></span>
<i class="icon <%= home_post_block_datetime_icon %>"></i>&nbsp;<span class="home-post-history"
data-updated="<%= home_post_block_datetime %>"
><%= date(home_post_block_datetime, home_post_datetime_format === 'ago' ? 'YYYY-MM-DD HH:mm:ss' : home_post_datetime_format) %></span>
</span>
<% } %>
<% if (page_type === 'post') { %>
<span class="meta-info-item post-create-date">
<i class="icon fa-solid fa-calendar-plus"></i>&nbsp;
<i class="icon <%= created_datetime_icon || 'fa-solid fa-calendar-plus' %>"></i>&nbsp;
<span class="datetime"><%= date(post.date, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<span class="meta-info-item post-update-date">
<i class="icon fa-solid fa-file-pen"></i>&nbsp;
<i class="icon <%= updated_datetime_icon || 'fa-solid fa-file-pen' %>"></i>&nbsp;
<span class="datetime" data-updated="<%= post.updated %>"><%= date(post.updated, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<% } %>
Expand All @@ -37,7 +55,6 @@ const home_tag_limit_number = 5
<% if (post.tags.length && (theme?.home?.tag === true || page_type === 'post')) { %>
<span class="post-tag meta-info-item border-box">
<i class="icon fas fa-tags"></i>&nbsp;
<ul class="post-tag-ul">
<% post.tags.forEach((tag, i) => {
if (home_tag_limit_number === 0 || i + 1 <= home_tag_limit_number || page_type === 'post') { %>
Expand Down
5 changes: 5 additions & 0 deletions layout/_partial/post/post-tools.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@
<span class="post-comments-count"></span>
</li>
<% } %>
<!-- PC full screen -->
<li class="tools-item flex-center full-screen">
<i class="fa-solid fa-expand"></i>
</li>
</ul>
</div>
11 changes: 8 additions & 3 deletions layout/_partial/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,25 @@
<% } %>
<% } %>
<!-- category-page -->
<!-- categories page -->
<% if (is_current('/categories') || is_current('/category')) { %>
<%- __js('js/page/category-page.js') %>
<% } %>
<!-- links-page -->
<!-- links page -->
<% if (is_current('/links') || is_current('/link')) { %>
<%- __js('js/page/links-page.js') %>
<% } %>
<!-- photos-page -->
<!-- photos page -->
<% if (is_current('/photos') || is_current('/photo')) { %>
<%- __js('js/page/photos-page.js') %>
<% } %>
<!-- tools page -->
<% if (is_current('/tools') || is_current('/tool')) { %>
<%- __js('js/page/tools-page.js') %>
<% } %>
</div>
<!-- mermaid -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ul class="friends-link-list border-box">
<% for (const f of theme?.links) { %>
<% for (const f of theme.source_data?.links) { %>
<% if (f?.title) { %>
<li class="link-type-title text-ellipsis border-box">
<span class="type-name text-ellipsis"><%= f.title %></span>
Expand Down
Loading

0 comments on commit 7017dc4

Please sign in to comment.