mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b90614fba4 | ||
|
|
6ee5480403 | ||
|
|
3ecb958423 | ||
|
|
82f780fc56 | ||
|
|
12acb69171 | ||
|
|
91d1aaca9b | ||
|
|
bf059cc25a | ||
|
|
db63a76823 | ||
|
|
e9dd671ed7 | ||
|
|
b6cbb64ab1 | ||
|
|
4d66cf46c9 | ||
|
|
726834cd48 | ||
|
|
fd72e89ba7 |
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
|
||||
2
.github/workflows/label-commenter.yml
vendored
2
.github/workflows/label-commenter.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: master
|
||||
- name: Label Commenter
|
||||
|
||||
2
.github/workflows/linter.yml
vendored
2
.github/workflows/linter.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
||||
linter:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
- name: Install Dependencies
|
||||
|
||||
2
.github/workflows/lock.yml
vendored
2
.github/workflows/lock.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v5
|
||||
- uses: dessant/lock-threads@v6
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-comment: >
|
||||
|
||||
16
.github/workflows/npm-publish.yml
vendored
16
.github/workflows/npm-publish.yml
vendored
@ -5,20 +5,22 @@ on:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
npm-publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '24'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: Update npm to latest version for OIDC support
|
||||
run: npm install -g npm@latest
|
||||
- run: |
|
||||
npm install
|
||||
npm publish --provenance
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
npm publish
|
||||
|
||||
6
.github/workflows/tester.yml
vendored
6
.github/workflows/tester.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
repository: hexojs/hexo-starter
|
||||
- name: Use Node.js
|
||||
@ -19,10 +19,10 @@ jobs:
|
||||
run: npm install
|
||||
- name: Install hexo-tag-embed
|
||||
run: npm install hexo-tag-embed
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
path: themes/next
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
repository: hexojs/hexo-many-posts
|
||||
path: source/_posts/hexo-many-posts
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ package-lock.json
|
||||
node_modules/
|
||||
.nyc_output/
|
||||
coverage/
|
||||
.env
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://hexo.io)
|
||||
[](https://hexo.io)
|
||||
[](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
|
||||
@ -43,7 +43,7 @@ scheme: Muse
|
||||
#scheme: Gemini
|
||||
|
||||
# Dark Mode
|
||||
darkmode: false
|
||||
darkmode: true
|
||||
|
||||
# Light-Dark Mode
|
||||
lightdark:
|
||||
@ -733,6 +733,10 @@ gitalk:
|
||||
# If you want everyone visiting your site to see a uniform language, you can set a force language value
|
||||
# Available values: en | es-ES | fr | ru | zh-CN | zh-TW
|
||||
language:
|
||||
# If you want to customize the content of the initialized Issue, please edit the body parameter.
|
||||
# For example:
|
||||
# body: Comments for post ${title}, see ${url}
|
||||
body:
|
||||
|
||||
# Utterances
|
||||
# For more information: https://utteranc.es
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://hexo.io)
|
||||
[](https://hexo.io)
|
||||
[](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||
[](https://hexo.io)
|
||||
[](https://hexo.io)
|
||||
[](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
|
||||
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-next",
|
||||
"version": "8.26.0",
|
||||
"version": "8.27.0",
|
||||
"description": "Elegant and powerful theme for Hexo.",
|
||||
"main": "package.json",
|
||||
"files": [
|
||||
@ -37,13 +37,13 @@
|
||||
"devDependencies": {
|
||||
"@next-theme/eslint-config": "0.0.5",
|
||||
"c8": "10.1.3",
|
||||
"chai": "6.2.0",
|
||||
"eslint": "9.39.0",
|
||||
"chai": "6.2.2",
|
||||
"eslint": "9.39.2",
|
||||
"hexo": "8.1.1",
|
||||
"hexo-renderer-marked": "7.0.1",
|
||||
"js-yaml": "4.1.0",
|
||||
"mocha": "11.7.4",
|
||||
"stylelint": "16.25.0",
|
||||
"js-yaml": "4.1.1",
|
||||
"mocha": "11.7.5",
|
||||
"stylelint": "16.26.1",
|
||||
"stylelint-stylus": "1.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
17
source/js/third-party/comments/gitalk.js
vendored
17
source/js/third-party/comments/gitalk.js
vendored
@ -3,6 +3,20 @@
|
||||
document.addEventListener('page:loaded', async () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
// Parse and replace body expressions
|
||||
const allowed = {
|
||||
title: document.title,
|
||||
url : location.href,
|
||||
path : location.pathname,
|
||||
lang : navigator.language
|
||||
};
|
||||
|
||||
const parsedBody = CONFIG.gitalk.body?.replace(/\$\{([^}]+)}/g, (_, keyRaw) => {
|
||||
const key = keyRaw.trim();
|
||||
if (!/^[A-Za-z0-9_]+$/.test(key)) return '';
|
||||
return String(allowed[key] ?? '');
|
||||
});
|
||||
|
||||
await NexT.utils.loadComments('.gitalk-container');
|
||||
await NexT.utils.getScript(CONFIG.gitalk.js, {
|
||||
condition: window.Gitalk
|
||||
@ -16,7 +30,8 @@ document.addEventListener('page:loaded', async () => {
|
||||
id : CONFIG.gitalk.path_md5,
|
||||
proxy : CONFIG.gitalk.proxy,
|
||||
language : CONFIG.gitalk.language || window.navigator.language,
|
||||
distractionFreeMode: CONFIG.gitalk.distraction_free_mode
|
||||
distractionFreeMode: CONFIG.gitalk.distraction_free_mode,
|
||||
body : parsedBody
|
||||
});
|
||||
gitalk.render(document.querySelector('.gitalk-container'));
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user