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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v4
|
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:
|
comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
- name: Label Commenter
|
- name: Label Commenter
|
||||||
|
|||||||
2
.github/workflows/linter.yml
vendored
2
.github/workflows/linter.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
|||||||
linter:
|
linter:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
|||||||
2
.github/workflows/lock.yml
vendored
2
.github/workflows/lock.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
lock:
|
lock:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v5
|
- uses: dessant/lock-threads@v6
|
||||||
with:
|
with:
|
||||||
github-token: ${{ github.token }}
|
github-token: ${{ github.token }}
|
||||||
issue-comment: >
|
issue-comment: >
|
||||||
|
|||||||
16
.github/workflows/npm-publish.yml
vendored
16
.github/workflows/npm-publish.yml
vendored
@ -5,20 +5,22 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
id-token: write # Required for OIDC
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
npm-publish:
|
npm-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
id-token: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
|
node-version: '24'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
- name: Update npm to latest version for OIDC support
|
||||||
|
run: npm install -g npm@latest
|
||||||
- run: |
|
- run: |
|
||||||
npm install
|
npm install
|
||||||
npm publish --provenance
|
npm publish
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|||||||
6
.github/workflows/tester.yml
vendored
6
.github/workflows/tester.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: hexojs/hexo-starter
|
repository: hexojs/hexo-starter
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
@ -19,10 +19,10 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
- name: Install hexo-tag-embed
|
- name: Install hexo-tag-embed
|
||||||
run: npm install hexo-tag-embed
|
run: npm install hexo-tag-embed
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
path: themes/next
|
path: themes/next
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: hexojs/hexo-many-posts
|
repository: hexojs/hexo-many-posts
|
||||||
path: source/_posts/hexo-many-posts
|
path: source/_posts/hexo-many-posts
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ package-lock.json
|
|||||||
node_modules/
|
node_modules/
|
||||||
.nyc_output/
|
.nyc_output/
|
||||||
coverage/
|
coverage/
|
||||||
|
.env
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
[](https://www.npmjs.com/package/hexo-theme-next)
|
[](https://www.npmjs.com/package/hexo-theme-next)
|
||||||
[](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/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%3ALinter)
|
||||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||||
|
|||||||
@ -43,7 +43,7 @@ scheme: Muse
|
|||||||
#scheme: Gemini
|
#scheme: Gemini
|
||||||
|
|
||||||
# Dark Mode
|
# Dark Mode
|
||||||
darkmode: false
|
darkmode: true
|
||||||
|
|
||||||
# Light-Dark Mode
|
# Light-Dark Mode
|
||||||
lightdark:
|
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
|
# 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
|
# Available values: en | es-ES | fr | ru | zh-CN | zh-TW
|
||||||
language:
|
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
|
# Utterances
|
||||||
# For more information: https://utteranc.es
|
# 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://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/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%3ALinter)
|
||||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
[](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://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/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%3ALinter)
|
||||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
[](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",
|
"name": "hexo-theme-next",
|
||||||
"version": "8.26.0",
|
"version": "8.27.0",
|
||||||
"description": "Elegant and powerful theme for Hexo.",
|
"description": "Elegant and powerful theme for Hexo.",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"files": [
|
"files": [
|
||||||
@ -37,13 +37,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@next-theme/eslint-config": "0.0.5",
|
"@next-theme/eslint-config": "0.0.5",
|
||||||
"c8": "10.1.3",
|
"c8": "10.1.3",
|
||||||
"chai": "6.2.0",
|
"chai": "6.2.2",
|
||||||
"eslint": "9.39.0",
|
"eslint": "9.39.2",
|
||||||
"hexo": "8.1.1",
|
"hexo": "8.1.1",
|
||||||
"hexo-renderer-marked": "7.0.1",
|
"hexo-renderer-marked": "7.0.1",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.1",
|
||||||
"mocha": "11.7.4",
|
"mocha": "11.7.5",
|
||||||
"stylelint": "16.25.0",
|
"stylelint": "16.26.1",
|
||||||
"stylelint-stylus": "1.0.0"
|
"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 () => {
|
document.addEventListener('page:loaded', async () => {
|
||||||
if (!CONFIG.page.comments) return;
|
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.loadComments('.gitalk-container');
|
||||||
await NexT.utils.getScript(CONFIG.gitalk.js, {
|
await NexT.utils.getScript(CONFIG.gitalk.js, {
|
||||||
condition: window.Gitalk
|
condition: window.Gitalk
|
||||||
@ -16,7 +30,8 @@ document.addEventListener('page:loaded', async () => {
|
|||||||
id : CONFIG.gitalk.path_md5,
|
id : CONFIG.gitalk.path_md5,
|
||||||
proxy : CONFIG.gitalk.proxy,
|
proxy : CONFIG.gitalk.proxy,
|
||||||
language : CONFIG.gitalk.language || window.navigator.language,
|
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'));
|
gitalk.render(document.querySelector('.gitalk-container'));
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user