diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 6e87a003..00000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# Editor configuration, see http://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -max_line_length = off -trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 9608e624..2e87f8d3 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ testem.log Thumbs.db .com.greenworldsoft.syncfolderspro _DelSyncFiles/ + +.env +.env.local diff --git a/DONATION.md b/DONATION.md index 1b46db71..809617d8 100644 --- a/DONATION.md +++ b/DONATION.md @@ -34,7 +34,7 @@ A big thank you to all the friends who have sponsored this project. Your support 赞助完以后,请各位加我微信 `do-not-go-plzzz` 联系我添加 GitHub 账号和网站链接! -After making a donation, if you want to get in touch with me, please add me on Discord with my username `evan404`. +After making a donation, if you want to get in touch with me, please add me on Discord with my username `evannotfound`. 感谢! Thank you! @@ -67,9 +67,12 @@ Thank you! | Jul 14 | 点点 | ¥8.88 | 微信赞赏码 | - | | Aug 1 | 风宇 | ¥14.99 | 微信赞赏码 | [https://krazyu.com](https://krazyu.com) | | Aug 27 | 匿名 | ¥88.00 | 微信赞赏码 | - | -| Sep 03 | Locam | ¥30.00 | 支付宝 | [https://locam-cyj.github.io](https://locam-cyj.github.io) | -| Sep 03 | 夜鹿 | ¥6.66 | 微信赞赏码 | - | -| Sep 03 | **辉 | ¥6.66 | 支付宝 | - | -| Sep 04 | 匿名 | ¥10.00 | 微信赞赏码 | - | -| Sep 23 | 今日店休. | ¥6.66 | 微信赞赏码 | - | -| Sep 29 | Ficon | ¥6.00 | 微信 | - | +| Sep 03 | Locam | ¥30.00 | 支付宝 | [https://locam-cyj.github.io](https://locam-cyj.github.io) | +| Sep 03 | 夜鹿 | ¥6.66 | 微信赞赏码 | - | +| Sep 03 | **辉 | ¥6.66 | 支付宝 | - | +| Sep 04 | 匿名 | ¥10.00 | 微信赞赏码 | - | +| Sep 23 | 今日店休. | ¥6.66 | 微信赞赏码 | - | +| Sep 29 | Ficon | ¥6.00 | 微信 | - | +| Oct 05 | Ryou | ¥14.99 | 微信赞赏码 | - | +| Oct 16 | 沈*昊 | ¥20.00 | 微信赞赏码 | - | +| Oct 24 | Neptune. | ¥14.99 | 微信赞赏码 | - | \ No newline at end of file diff --git a/README.md b/README.md index a1c17664..819732a7 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,19 @@ Drawing its core from [hexo-theme-keep](https://github.com/XPoet/hexo-theme-keep NodeJS Version

-

- - -## 📷 Screenshots - -![redefine-1-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/1c4f802b-b949-4313-8935-6ea5178be9e3) - -![redefine-2-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/bf6529a6-bce9-4388-899c-1d96325c49d6) - -![redefine-3-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/33ee3d7c-189c-4b75-89c9-914b0cb63caf) + + + + Cover Image + + + + + + Pages Image + +

## 🌐 Demo @@ -148,4 +150,4 @@ Thanks to all of you! ## 💻 Development -If you want to contribute to this project, you can clone the `dev` branch and check out the [Development Docs](https://redefine-docs.ohevan.com/developer) to get started. \ No newline at end of file +If you want to contribute to this project, you can clone the `dev` branch and check out the [Development Docs](https://redefine-docs.ohevan.com/developer) to get started. diff --git a/README_zh-CN.md b/README_zh-CN.md index d2e38c28..cc94c5b6 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -28,13 +28,19 @@

-## 📷 屏幕截图 - -![redefine-1-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/1c4f802b-b949-4313-8935-6ea5178be9e3) - -![redefine-2-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/bf6529a6-bce9-4388-899c-1d96325c49d6) - -![redefine-3-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/33ee3d7c-189c-4b75-89c9-914b0cb63caf) +

+ + + + Cover Image + + + + + + Pages Image + +

## 🌐 官方演示站 diff --git a/README_zh-TW.md b/README_zh-TW.md index 651fa1de..3e5c0a3e 100644 --- a/README_zh-TW.md +++ b/README_zh-TW.md @@ -29,13 +29,19 @@ -## 📷 屏幕截圖 - -![redefine-1-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/1c4f802b-b949-4313-8935-6ea5178be9e3) - -![redefine-2-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/bf6529a6-bce9-4388-899c-1d96325c49d6) - -![redefine-3-final](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/33ee3d7c-189c-4b75-89c9-914b0cb63caf) +

+ + + + Cover Image + + + + + + Pages Image + +

## 🌐 在線演示站 @@ -145,4 +151,4 @@ $ git clone https://github.com/EvanNotFound/hexo-theme-redefine.git themes/redef 如果你想參與主題開發,請 `clone` 本專案的 `dev` 分支,然後在 `dev` 分支上進行開發。 -同時,請查看 [Redefine 主題開發文件](https://redefine-docs.ohevan.com/developer)。 \ No newline at end of file +同時,請查看 [Redefine 主題開發文件](https://redefine-docs.ohevan.com/developer)。 diff --git a/_config.yml b/_config.yml index cb779809..ece83394 100755 --- a/_config.yml +++ b/_config.yml @@ -44,12 +44,12 @@ global: fonts: # Chinese fonts chinese: - enable: false # Whether to enable custom chinese font + enable: false # Whether to enable custom chinese fonts family: # Font family url: # Font URL to CSS file # English fonts english: - enable: false # Whether to enable custom chinese font + enable: false # Whether to enable custom english fonts family: # Font family url: # Font URL to CSS file # Content max width @@ -243,6 +243,7 @@ articles: image_alignment: center # image alignment. left, center image_caption: false # Whether to display image caption link_icon: true # Whether to display link icon + title_alignment: left # Title alignment. left, center # Word count. Requires hexo-wordcount (npm install hexo-wordcount). See https://github.com/willin/hexo-wordcount word_count: enable: true # Whether to enable @@ -269,7 +270,9 @@ articles: expand: true # Whether to expand TOC init_open: true # Open toc by default # Whether to enable copyright notice - copyright: true + copyright: + enable: true # Whether to enable + default: cc_by_nc_sa # Default license, can be cc_by_nc_sa, cc_by_nd, cc_by_nc, cc_by_sa, cc_by, all_rights_reserved, public_domain # Whether to enable lazyload for images lazyload: true # Article recommendation. Requires nodejieba (npm install nodejieba). Transplanted from hexo-theme-volantis. diff --git a/layout/_meta/article-copyright.ejs b/layout/_meta/article-copyright.ejs index 511afc54..03b54794 100755 --- a/layout/_meta/article-copyright.ejs +++ b/layout/_meta/article-copyright.ejs @@ -17,30 +17,64 @@ <%- __('copyright.license_title') %>: - <% if (page.copyright && page.copyright !== "") { %> - <%= page.copyright %> - <% } else if (page.license) { %> - <% if (page.license === 'all_rights_reserved') { %> - <%- __('copyright.all_rights_reserved', theme.info.author) %> - <% } else if (page.license === 'cc_by') { %> - <%- __('copyright.license_content', '
CC BY 4.0') %> - <% } else if (page.license === 'cc_by_sa') { %> - <%- __('copyright.license_content', 'CC BY-SA 4.0') %> - <% } else if (page.license === 'cc_by_nc') { %> - <%- __('copyright.license_content', 'CC BY-NC 4.0') %> - <% } else if (page.license === 'cc_by_nd') { %> - <%- __('copyright.license_content', 'CC BY-ND 4.0') %> - <% } else if (page.license === 'cc_by_nc_sa') { %> - <%- __('license_content', 'CC BY-NC-SA 4.0') %> - <% } else if (page.license === 'public_domain') { %> - <%- __('copyright.public_domain') %> - <% } else { %> - <%- __('copyright.license_content', 'CC BY-NC-SA 4.0') %> - <% } %> + <% + const licenseMap = { + 'all_rights_reserved': { + label: __('copyright.all_rights_reserved', theme.info.author), + url: null + }, + 'cc_by': { + label: __('copyright.license_content', 'CC BY 4.0'), + url: 'https://creativecommons.org/licenses/by/4.0' + }, + 'cc_by_sa': { + label: __('copyright.license_content', 'CC BY-SA 4.0'), + url: 'https://creativecommons.org/licenses/by-sa/4.0' + }, + 'cc_by_nc': { + label: __('copyright.license_content', 'CC BY-NC 4.0'), + url: 'https://creativecommons.org/licenses/by-nc/4.0' + }, + 'cc_by_nd': { + label: __('copyright.license_content', 'CC BY-ND 4.0'), + url: 'https://creativecommons.org/licenses/by-nd/4.0' + }, + 'cc_by_nc_sa': { + label: __('license_content', 'CC BY-NC-SA 4.0'), + url: 'https://creativecommons.org/licenses/by-nc-sa/4.0' + }, + 'public_domain': { + label: __('copyright.public_domain'), + url: null + } + }; + const isValidLicense = (licenseKey) => { + return licenseMap.hasOwnProperty(licenseKey); + }; + + + const getLicenseType = () => { + if (page.copyright && page.copyright !== "") { + return 'custom'; + } else if (page.license && isValidLicense(page.license)) { + return page.license; + } else if (theme.articles.copyright.default && isValidLicense(theme.articles.copyright.default)) { + return theme.articles.copyright.default; + } else { + return 'cc_by_nc_sa'; + } + }; + const licenseType = getLicenseType(); + + %> + + <% if (licenseType === 'custom') { %> + <%- page.copyright %> <% } else { %> - <%- __('copyright.license_content', 'CC BY-NC-SA 4.0') %> + <%- licenseMap[licenseType].label %> <% } %> + diff --git a/layout/_partials/comments/gitalk.ejs b/layout/_partials/comments/gitalk.ejs index b7921100..5c0dbbe7 100755 --- a/layout/_partials/comments/gitalk.ejs +++ b/layout/_partials/comments/gitalk.ejs @@ -7,7 +7,7 @@ ) { %>
+ src="//cdn.staticfile.org/gitalk/1.8.0/gitalk.min.js"> - -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partials/home-content.ejs b/layout/_partials/home-content.ejs index 031a6026..ec589242 100755 --- a/layout/_partials/home-content.ejs +++ b/layout/_partials/home-content.ejs @@ -25,34 +25,35 @@ <% } %> <% if (post.thumbnail !== false && (post.thumbnail || post.cover || post.banner)) { %> -
+
<%= post.title %>
<% } %> +
"> +

+ + <%= post.title %> + +

-

- - <%= post.title %> - -

+
+ <% if (post.excerpt && post.excerpt == "false") { %> + <% } else if (post.excerpt && post.excerpt !== "false") { %> + <%- render(post.excerpt, "markdown") %> + <% } else { %> + <%- truncate(strip_html(post.content), {length: 128}) %> + <% } %> +
-
- <% if (post.excerpt && post.excerpt == "false") { %> - <% } else if (post.excerpt && post.excerpt !== "false") { %> - <%- render(post.excerpt, "markdown") %> - <% } else { %> - <%- truncate(strip_html(post.content), {length: 128}) %> - <% } %> + <%- partial('_meta/home-article', {post: post}) %>
- - <%- partial('_meta/home-article', {post: post}) %> <% }) %> -
+
<%- partial('_widgets/paginator', {pageObject: page}) %>
diff --git a/layout/_widgets/tagcloud.ejs b/layout/_widgets/tagcloud.ejs index 77f03df9..3851d01b 100755 --- a/layout/_widgets/tagcloud.ejs +++ b/layout/_widgets/tagcloud.ejs @@ -1,26 +1,24 @@ <% if (site.tags.length){ %>
- <% if (theme.page_templates.tags_style == 'cloud') { %>

<%- __('tags') %>

+ + <% if (theme.page_templates.tags_style == 'cloud') { %>
<%- tagcloud({ min_font: 1, max_font: 5, unit: 'rem', amount: 100 }) %>
<% } else {%> -
-

<%- __('tags') %>

-
<% } %> diff --git a/layout/article-content.ejs b/layout/article-content.ejs index 56fd5393..28d08b57 100755 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -1,7 +1,7 @@
-
+
<% if (page.cover || page.banner || (page.thumbnail && page.thumbnail !== false)) { %> <% let articleCover = ""; if (page.cover && page.cover.includes("/")) { @@ -15,18 +15,20 @@ } %> <% if (articleCover) { %> - <%= page.title %> + <%= page.title %> <% } %> -

<%= page.title %>

+
"> +

<%= page.title %>

+
<% } else { %> -

<%= page.title %>

+
"> +

<%= page.title %>

+
<% } %>
- - - + <% if (theme.info.author || config.author) { %> -
+
<%- image_tag((typeof page.avatar === "string" && (page.avatar)) || page.author?.avatar || theme.defaults.avatar) %>
@@ -43,7 +45,7 @@
<% } else { %> -
+
<%- partial('_meta/article-info', {articleObject: page, index: true}) %>
@@ -51,9 +53,9 @@ <% } %> <% if (page.expires && page.expires !== "") {%> -