Compare commits

...

13 Commits

Author SHA1 Message Date
Mimi
b90614fba4 Update npm-publish.yml 2026-01-06 11:37:02 +08:00
Mimi
6ee5480403 Release v8.27.0 2025-12-31 23:54:18 +08:00
Mimi
3ecb958423 Update .gitignore 2025-12-31 23:52:15 +08:00
renovate[bot]
82f780fc56
Update dessant/lock-threads action to v6 (#944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:47:14 +08:00
renovate[bot]
12acb69171
Update dependency stylelint to v16.26.1 (#941)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:46:54 +08:00
renovate[bot]
91d1aaca9b
Update actions/checkout action to v6 (#940)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:45:28 +08:00
renovate[bot]
bf059cc25a
Update dependency js-yaml to v4.1.1 [SECURITY] (#939)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:45:15 +08:00
renovate[bot]
db63a76823
Update dependency chai to v6.2.2 (#934)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:43:07 +08:00
renovate[bot]
e9dd671ed7
Update dependency mocha to v11.7.5 (#932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:40:36 +08:00
renovate[bot]
b6cbb64ab1
Update dependency eslint to v9.39.2 (#931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 23:39:58 +08:00
Mimi
4d66cf46c9 Enable darkmode by default 2025-11-26 20:08:12 +08:00
Mimi
726834cd48 Update Hexo version 2025-11-04 17:21:42 +08:00
TootsCharlie
fd72e89ba7
Add body option to gitalk configuration to support custom issue content (#877)
Co-authored-by: Mimi <1119186082@qq.com>
2025-11-03 20:55:40 +08:00
13 changed files with 47 additions and 25 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: >

View File

@ -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

View File

@ -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
View File

@ -8,3 +8,4 @@ package-lock.json
node_modules/
.nyc_output/
coverage/
.env

View File

@ -19,7 +19,7 @@
[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=7.0.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=for-the-badge&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)

View File

@ -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

View File

@ -19,7 +19,7 @@
[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=7.0.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=for-the-badge&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)

View File

@ -19,7 +19,7 @@
[![NPM version](https://img.shields.io/npm/v/hexo-theme-next?color=red&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![NPM Downloads](https://img.shields.io/npm/dm/hexo-theme-next?logo=npm&style=for-the-badge)](https://www.npmjs.com/package/hexo-theme-next)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=5.3.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![Required Hexo version](https://img.shields.io/badge/hexo-%3E=7.0.0-blue?style=for-the-badge&logo=hexo)](https://hexo.io)
[![License](https://img.shields.io/badge/license-%20AGPL-orange?style=for-the-badge&logo=gnu)](https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/linter.yml?branch=master&label=test&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
[![Build Status](https://img.shields.io/github/actions/workflow/status/next-theme/hexo-theme-next/tester.yml?branch=master&logo=github&style=for-the-badge)](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)

View File

@ -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"
}
}

View File

@ -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'));
});