Skip to content

Commit

Permalink
Merge pull request #1 from EvanNotFound/dev
Browse files Browse the repository at this point in the history
[Update] Theme Redefine v0.2.0
  • Loading branch information
EvanNotFound authored Oct 3, 2022
2 parents 7aeba82 + 1dcf3a8 commit 5dd6a4a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
23 changes: 12 additions & 11 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
base_info:
title: Theme Redefine # Site title
author: The Redefine Team # Author name
url: https://www.evanluo.top # Site url
url: https://redefine.evanluo.top # Site url
# Logo image (You can use local image, image external link or don’t fill)
logo_img: # logo image on the left of the navigation bar

Expand Down Expand Up @@ -157,15 +157,16 @@ local_search:
# Comment plugin
# ---------------------------------------------------------------------------------------
comment:
enable: true
use: twikoo # values: valine | gitalk | twikoo
enable: false
use: waline # values: waline | gitalk | twikoo

# Valine
# See: https://github.com/xCss/Valine
valine:
appid: # your leancloud application appid
appkey: # your leancloud application appkey
placeholder: # your placeholder
# Waline
# See: https://waline.js.org/guide/get-started.html
waline:
serverUrl: # Waline server url(vercel) example: https://example.example.com
lang: zh-CN # Waline language, default: zh-CN. See: https://waline.js.org/guide/client/i18n.html
dark: auto # Waline dark mode, default: auto. See: https://waline.js.org/reference/component.html#dark
requiredMeta: ['nick'] # Waline required meta, default: ['nick'], see: https://waline.js.org/reference/component.html#requiredmeta

# Gitalk
# See: https://github.com/gitalk/gitalk
Expand All @@ -180,7 +181,7 @@ comment:
twikoo:
visitor: true
env_id: # Vercel or Tencent Cloud Function environment ID
#region: # environment region. If select Guangzhou, fill in "ap-guangzhou".
region: # environment region. If select Guangzhou, fill in "ap-guangzhou". (optional)

# ---------------------------------------------------------------------------------------
# RSS
Expand Down Expand Up @@ -218,4 +219,4 @@ footer:
# ---------------------------------------------------------------------------------------
# Redefine Theme version (Please don't modify)
# ---------------------------------------------------------------------------------------
version: 0.1
version: 0.2.0
4 changes: 2 additions & 2 deletions layout/_partial/comment/comment.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</div>
<% if (theme.comment.enable === true && theme.comment.hasOwnProperty(theme.comment.use)) { %>
<% if (theme.comment.use === 'valine') { %>
<%- partial('valine') %>
<% if (theme.comment.use === 'waline') { %>
<%- partial('waline') %>
<% } else if (theme.comment.use === 'gitalk') { %>
<%- partial('gitalk') %>
Expand Down
31 changes: 16 additions & 15 deletions layout/_partial/comment/waline.ejs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<head>
<!-- ... -->
<script src="/js/waline.js"></script>
<link
rel="stylesheet"
href="/css/waline.css"
/>
<!-- ... -->
</head>
<body>
<!-- ... -->
<% if(
theme.comment.use === 'waline'
&& theme.comment.waline.serverUrl
&& theme.comment.waline.lang
&& theme.comment.waline.dark
&& theme.comment.waline.requiredMeta
) { %>
<div id="waline"></div>
<script>
<script <%= theme.pjax.enable === true ? 'data-pjax' : '' %>>
Waline.init({
el: '#waline',
serverURL: 'https://waline-ochre.vercel.app/',
el: '#waline',
serverURL: '<%= theme.comment.waline.serverUrl %>',
lang: '<%= theme.comment.waline.lang %>',
dark: '<%= theme.comment.waline.dark %>',
requiredMeta: <%= theme.comment.waline.requiredMeta %>,
});
</script>
</body>
<% } %>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-redefine",
"version": "0.1.1",
"version": "0.2.0",
"private": false,
"description": "\"Redefine\" hexo theme is a simple & fast & pure theme, but with no compromise.",
"scripts": {
Expand Down

0 comments on commit 5dd6a4a

Please sign in to comment.