Skip to content

Commit

Permalink
Merge pull request #236 from XPoet/dev
Browse files Browse the repository at this point in the history
release v3.7.2
  • Loading branch information
XPoet authored Aug 14, 2023
2 parents fe72c2c + 71bb458 commit df7281d
Show file tree
Hide file tree
Showing 48 changed files with 417 additions and 307 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm publish

- name: Install
run: npm install

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
22 changes: 4 additions & 18 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## ======================================================================================
## Keep v3.7.1
## Keep v3.7.2
## Preview: https://xpoet.cn
## Documents: https://keep-docs.xpoet.cn
## Repository: https://github.com/XPoet/hexo-theme-keep
Expand Down Expand Up @@ -34,13 +34,6 @@ style:
# Avatar (You can use local image or image external link)
avatar: /images/avatar.svg

# Mouse hover style settings
hover:
# Shadow effect when the mouse hover
shadow: false # Option values: true | false
# Scale effect when the mouse hovers
scale: false # Option values: true | false

# First screen style settings
first_screen:
enable: false # Option values: true | false
Expand All @@ -55,10 +48,6 @@ style:
# You can use the "||" to begin a newline, maximum is two lines.
description: Keep writing and Keep loving.

# If you want to customize the first screen font color, you can fill in here (e.g. "#0066CC")
# Otherwise use the theme default font color
font_color:

# If enable hitokoto, first screen description is different every time when you enter the site
hitokoto: false # Option values: true | false

Expand Down Expand Up @@ -144,10 +133,7 @@ post:
min2read: false # Time to read, one article. Option values: true | false

# Post datetime
datetime:
create: true # Article create time. Option values: true | false
update: true # Article update time. Option values: true | false
format: "YYYY-MM-DD HH:mm:ss" # Datetime format. e.g. "YYYY-MM-DD HH:mm:ss"
datetime_format: "YYYY-MM-DD HH:mm:ss" # Datetime format. e.g. "YYYY-MM-DD HH:mm:ss"

# Image align position in the post
img_align: left # Option values: left | center
Expand Down Expand Up @@ -322,10 +308,10 @@ footer:

# e.g.
# - link_url: https://github.com/XPoet/hexo-theme-keep
# img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.1-blue?style=flat-square&logo=hexo
# img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.2-blue?style=flat-square&logo=hexo
#
# - link_url: https://github.com/XPoet/hexo-theme-keep
# img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.1-red?style=flat-square&logo=hexo
# img_url: https://img.shields.io/badge/Hexo-Keep%20v3.7.2-red?style=flat-square&logo=hexo
#
# - ...

Expand Down
21 changes: 10 additions & 11 deletions layout/_partial/archive-list.ejs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<% const archive_post_list = createNewArchivePosts(archive_posts) %>
<div class="archive-list-container">
<% archive_post_list.forEach(postYear => { %>
<section class="archive-item">
<div class="archive-item-header">
<span class="archive-year"><%= postYear.year %></span>
<span class="archive-year-post-count">[<%= postYear.postList.length %>]</span>
<div class="archive-list-container border-box">
<% archive_post_list.forEach(postItem => { %>
<section class="archive-item border-box">
<div class="archive-item-header border-box">
<span class="archive-year"><%= postItem.year %></span>
</div>
<ul class="article-list">
<% postYear.postList.forEach(post => { %>
<li class="article-item">
<a class="article-title"
<ul class="article-list border-box">
<% postItem.postList.forEach(post => { %>
<li class="article-item border-box">
<a class="article-title border-box text-ellipsis"
href="<%- url_for(post.path) %>"
><%= post.title %></a>
<span class="article-date"><%= date(post.date, 'MM-DD') %></span>
<span class="article-date border-box"><%= date(post.date, 'MM-DD') %></span>
</li>
<% }) %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/article-copyright-info.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const colon = config.language === 'en' ? ': ' : ':'
<span class="type"><%- __('copyright.title') %></span><%= colon %><span class="content"><%= page.title %></span>
</li>
<li class="post-author">
<span class="type"><%- __('copyright.author') %></span><%= colon %><span class="content"><%= theme.base_info.author || config.author %></span>
<span class="type"><%- __('copyright.author') %></span><%= colon %><span class="content"><%= theme?.base_info?.author || config.author %></span>
</li>
<li class="post-time">
<span class="type"><%- __('copyright.create_time') %></span><%= colon %><span class="content"><%= date(page.date, 'YYYY-MM-DD HH:mm:ss') %></span>
Expand Down
22 changes: 9 additions & 13 deletions layout/_partial/article-meta-info.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@


<% if (page_type === 'post') { %>
<% if (theme.post?.datetime?.create !== false) { %>
<span class="meta-info-item article-date">
<i class="icon fa-regular fa-calendar-plus"></i>&nbsp;
<span class="pc"><%= date(post.date, theme.post?.datetime?.format || 'YYYY-MM-DD HH:mm:ss') %></span>
<span class="mobile"><%= date(post.date, 'YYYY-MM-DD HH:mm') %></span>
</span>
<% } %>
<span class="meta-info-item article-create-date">
<i class="icon fa-solid fa-calendar-check"></i>&nbsp;
<span class="pc"><%= date(post.date, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
<span class="mobile"><%= date(post.date, 'YYYY-MM-DD HH:mm') %></span>
</span>
<% if (theme.post?.datetime?.update !== false) { %>
<span class="meta-info-item article-update-date">
<i class="icon fas fa-file-pen"></i>&nbsp;
<span class="pc"><%= date(post.updated, theme.post?.datetime?.format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<% } %>
<span class="meta-info-item article-update-date">
<i class="icon fa-solid fa-file-pen"></i>&nbsp;
<span class="pc"><%= date(post.updated, theme.post?.datetime_format || 'YYYY-MM-DD HH:mm:ss') %></span>
</span>
<% } %>
<% if ((post.categories.length && theme.home_article.category.enable === true) || page_type === 'post') { %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/comment/valine.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (t_cdn_enable === true) {
const getValineDomTimer = setInterval(() => {
const vcards = document.querySelectorAll('#vcomments .vcards .vcard')
if (vcards.length > 0) {
let author = '<%= theme.base_info.author || config.author %>'
let author = '<%= theme?.base_info?.author || config.author %>'
if (author) {
for (let vcard of vcards) {
Expand Down
3 changes: 3 additions & 0 deletions layout/_partial/common/empty-content.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="empty-content-box border-box">
<i class="fa-solid fas fa-box-open fa-5x"></i>
</div>
6 changes: 3 additions & 3 deletions layout/_partial/first-screen.ejs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%
const { description: fs_description, hitokoto: fs_hitokoto } = theme.style.first_screen
const { description: fs_description, hitokoto: fs_hitokoto } = theme?.style?.first_screen || {}
const { description: c_description } = config
let final_description = fs_description || c_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
const { enable: sc_enable, links: sc_links } = theme?.social_contact || {}
%>
<div class="first-screen-container border-box flex-center fade-in-down-animation">
<div class="first-screen-content border-box">
Expand All @@ -20,7 +20,7 @@ const { enable: sc_enable, links: sc_links } = theme.social_contact
<% } %>
<% if (fs_hitokoto === true) { %>
<script async <%= theme.pjax.enable === true ? 'data-pjax' : '' %>
<script async <%= theme?.pjax?.enable === true ? 'data-pjax' : '' %>
src="https://v1.hitokoto.cn/?encode=js"
>
</script>
Expand Down
6 changes: 3 additions & 3 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
icp: f_icp,
site_deploy: f_site_deploy
} = theme.footer
const { author: bi_author } = theme.base_info
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 footer_style_type = theme.footer?.shields_style?.enable === true ? 'shields' : 'default'
Expand Down Expand Up @@ -37,7 +37,7 @@ const web_master = bi_author || hexo_author
<img src="https://img.shields.io/badge/Powered_by-Hexo-<%= shields_color_list[3] %>?style=<%= shields_style %>">
</a>
<a class="shields-item" href="https://github.com/XPoet/hexo-theme-keep" target="_blank">
<img src="https://img.shields.io/badge/Theme-Keep%20v3.7.1-<%= shields_color_list[4] %>?style=<%= shields_style %>">
<img src="https://img.shields.io/badge/Theme-Keep%20v3.7.2-<%= shields_color_list[4] %>?style=<%= shields_style %>">
</a>
<% if (f_site_deploy?.enable === true && f_site_deploy?.provider !== '') { %>
<a class="shields-item<%= f_site_deploy?.url ? '' : ' no-pointer' %>"
Expand Down Expand Up @@ -72,7 +72,7 @@ const web_master = bi_author || hexo_author
</div>
<div class="theme-info info-item <%= footer_style_type %>">
<%- __('footer.powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %>&nbsp;|&nbsp;<%- __('theme') %>&nbsp;<a class="theme-version" target="_blank" href="https://github.com/XPoet/hexo-theme-keep">Keep v3.7.1</a>
<%- __('footer.powered_by', '<a target="_blank" href="https://hexo.io">Hexo</a>') %>&nbsp;|&nbsp;<%- __('theme') %>&nbsp;<a class="theme-version" target="_blank" href="https://github.com/XPoet/hexo-theme-keep">Keep v3.7.2</a>
</div>
<% if (f_icp?.enable && f_icp?.record_code) { %>
Expand Down
12 changes: 7 additions & 5 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="<%= page.keywords || config.keywords || 'Hexo Theme Keep' %>">
<meta name="description" content="<%= page.description || config.description || 'Hexo Theme Keep' %>">
<meta name="author" content="<%= theme.base_info.author || config.author || 'Keep Team' %>">
<meta name="keywords" content="<%= page?.keywords || config?.keywords || 'Hexo Theme Keep' %>">
<meta name="description" content="<%= page?.description || config?.description || 'Hexo Theme Keep' %>">
<meta name="author" content="<%= theme?.base_info?.author || config?.author || 'Keep Team' %>">
<%
let title = page.title;
if (is_archive()) {
Expand All @@ -25,10 +25,12 @@
<% if (title) { %>
<%= title %> |
<% } %>
<%= theme.base_info.title || config.title || 'Keep Theme' %>
<%= theme?.base_info?.title || config?.title || 'Keep Theme' %>
</title>
<%- css('css/style') %>
<%- favicon_tag(theme.style.favicon) %>
<% if (theme?.style?.favicon) { %>
<%- favicon_tag(theme?.style?.favicon) %>
<% } %>
<%- __css('font/css/fontawesome.min.css') %>
<%- __css('font/css/regular.min.css') %>
<%- __css('font/css/solid.min.css') %>
Expand Down
21 changes: 10 additions & 11 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<%
const { title: bi_title, logo_img: bi_logo_img } = theme.base_info
const { logo: s_logo, first_screen: s_first_screen } = theme.style
const { enable: s_fs_enable, header_transparent: s_fs_header_transparent } = s_first_screen
const { title: config_title } = config
const { enable: local_search_enable } = theme.local_search
const { title: bi_title, logo_img: bi_logo_img } = theme?.base_info || {}
const { logo: s_logo, first_screen: s_first_screen } = theme?.style || {}
const { enable: s_fs_enable, header_transparent: s_fs_header_transparent } = s_first_screen || {}
const { enable: local_search_enable } = theme?.local_search || {}
%>
<header class="header-wrapper<%= s_fs_enable === true && is_home() && s_fs_header_transparent ? ' transparent-1' : '' %>">
<div class="header-content<%- (s_fs_enable === true && is_home() && !page.prev) ? ' has-first-screen' : '' %>">
<div class="left">
<div class="border-box header-content<%- (s_fs_enable === true && is_home() && !page.prev) ? ' has-first-screen' : '' %>">
<div class="left border-box">
<% if (s_logo || bi_logo_img) { %>
<a class="logo-image" href="/">
<a class="logo-image border-box" href="/">
<%- image_tag(s_logo || bi_logo_img) %>
</a>
<% } %>
<a class="site-name" href="/">
<%= bi_title || config_title || 'Keep Theme' %>
<a class="site-name border-box" href="/">
<%= bi_title || config?.title || 'Keep Theme' %>
</a>
</div>
<div class="right">
<div class="right border-box">
<div class="pc">
<ul class="menu-list">
<% for (const i in theme.menu) { %>
Expand Down
27 changes: 17 additions & 10 deletions layout/_partial/paginator.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<div class="paginator border-box">
<a class="btn jump-btn<%= pageObject.prev ? ' show' : '' %>"
href="<%- url_for(pageObject.prev_link) %>"
><%- __('prev') %></a>
<% if (page.total > 1) { %>
<div class="paginator border-box flex-center">
<div class="btn-wrap<%= page_info.prev ? ' allowed' : '' %>">
<a class="jump-btn"
href="<%- url_for(page_info.prev_link) %>"
><i class="fa-solid fa-chevron-left"></i></a>
</div>
<% if (page.total > 1) { %>
<div class="page-number-box border-box flex-center">
<input class="page-number-input border-box base-color-size"
type="number"
Expand All @@ -12,10 +15,14 @@
max="<%- page.total %>"
><span class="delimiter base-color-size">/</span><span class="base-color-size"><%- page.total %></span>
</div>
<% } %>
<a class="btn jump-btn<%= pageObject.next ? ' show' : '' %>"
href="<%- url_for(pageObject.next_link) %>"
><%- __('next') %></a>
</div>
<div class="btn-wrap<%= page_info.next ? ' allowed' : '' %>">
<a class="jump-btn"
href="<%- url_for(page_info.next_link) %>"
><i class="fa-solid fa-chevron-right"></i></a>
</div>
</div>
<% } %>


4 changes: 2 additions & 2 deletions layout/_partial/side-tools.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</li>
<% } %>

<% if (theme.style.scroll.percent !== true) { %>
<% if (theme?.style?.scroll?.percent !== true) { %>
<li class="tools-item tool-scroll-to-top flex-center">
<i class="fas fa-arrow-up"></i>
</li>
Expand Down Expand Up @@ -52,7 +52,7 @@
<i class="fas fa-cog fa-spin"></i>
</li>
<% if (theme.style.scroll.percent === true) { %>
<% 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>
Expand Down
18 changes: 10 additions & 8 deletions layout/_partial/tagcloud.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if (site.tags.length){ %>
<div class="fade-in-down-animation">
<div class="tagcloud-container">
<div class="fade-in-down-animation">
<div class="tagcloud-container">
<% if (site.tags.length){ %>
<div class="tagcloud-content">
<%- tagcloud({
min_font: 1,
Expand All @@ -9,11 +9,13 @@
amount: 100
}) %>
</div>
<% } else { %>
<%- partial('_partial/common/empty-content') %>
<% } %>
<% if (page?.comment === true) { %>
<div class="tagcloud-comments">
<% if (page?.comment === true) { %>
<%- partial('_partial/comment/comment') %>
<% } %>
<%- partial('_partial/comment/comment') %>
</div>
</div>
<% } %>
</div>
<% } %>
</div>
7 changes: 5 additions & 2 deletions layout/archive-content.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="fade-in-down-animation">
<div class="archive-container">
<%- partial('_partial/archive-list', { archive_posts: site.posts }) %>
<div class="archives-container">
<div class="archives-timeline border-box">
<%- partial('_partial/archive-list', { archive_posts: page.posts }) %>
</div>
</div>
<%- partial('_partial/paginator', { page_info: page }) %>
</div>
16 changes: 9 additions & 7 deletions layout/article-content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@
<span class="title-hover-animation"><%= page.title %></span>
</div>

<% if (theme.base_info?.author || config?.author) { %>
<% if (theme?.base_info?.author || config?.author) { %>
<div class="article-header border-box">
<div class="avatar-box border-box">
<%- image_tag(theme?.style?.avatar) %>
</div>
<% if (theme?.style?.avatar) { %>
<div class="avatar-box border-box">
<%- image_tag(theme?.style?.avatar) %>
</div>
<% } %>
<div class="info-box">
<div class="author">
<span class="name"><%= theme.base_info?.author || config?.author %></span>
<span class="name"><%= theme?.base_info?.author || config?.author %></span>
<% if (theme?.post?.author_label?.enable === true) { %>
<span class="author-label"><%- getAuthorLabel(site.posts.length, theme.post.author_label.auto, theme.post.author_label.custom_label_list) %></span>
<% } %>
</div>
<div class="meta-info">
<div class="meta-info border-box">
<%- partial('_partial/article-meta-info', { post: page, page_type: 'post' }) %>
</div>
</div>
</div>
<% } else { %>
<div class="article-header-meta-info">
<div class="meta-info">
<div class="meta-info border-box">
<%- partial('_partial/article-meta-info', { post: page, page_type: 'post' }) %>
</div>
</div>
Expand Down
Loading

0 comments on commit df7281d

Please sign in to comment.