Skip to content

Commit

Permalink
Merge branch 'next-theme:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
triccsr authored Mar 4, 2024
2 parents 4ee3c8b + eaa762d commit 4e48524
Show file tree
Hide file tree
Showing 17 changed files with 102 additions and 61 deletions.
32 changes: 24 additions & 8 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# Configuration for labeler - https://github.com/actions/labeler

📦 Dependencies: package.json
Configurations: _config.yml
CSS: source/css/**/*
📖 Docs: docs/**/*
Layout: layout/**/*
🌍 i18n: languages/**/*
Actions: .github/workflows/**/*
🔌 3rd Party Plugin: '**/*third-party/**/*'
📦 Dependencies:
- changed-files:
- any-glob-to-any-file: package.json
Configurations:
- changed-files:
- any-glob-to-any-file: _config.yml
CSS:
- changed-files:
- any-glob-to-any-file: source/css/**/*
📖 Docs:
- changed-files:
- any-glob-to-any-file: docs/**/*
Layout:
- changed-files:
- any-glob-to-any-file: layout/**/*
🌍 i18n:
- changed-files:
- any-glob-to-any-file: languages/**/*
Actions:
- changed-files:
- any-glob-to-any-file: .github/workflows/**/*
🔌 3rd Party Plugin:
- changed-files:
- any-glob-to-any-file: '**/*third-party/**/*'
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master
- name: Label Commenter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
# https://github.com/peaceiris/actions-label-commenter#work-with-other-auto-label-actions
with:
repo-token: "${{ secrets.GH_PAT }}"
6 changes: 3 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
- name: Install Dependencies
run: npm install
- run: npm run eslint
Expand All @@ -21,7 +21,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-comment: >
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: hexojs/hexo-starter
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
- name: Install Dependencies
run: npm install
- uses: actions/checkout@v3
- name: Install hexo-tag-embed
run: npm install hexo-tag-embed
- uses: actions/checkout@v4
with:
path: themes/next
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: SukkaLab/hexo-many-posts
path: source/_posts/hexo-many-posts
Expand Down
6 changes: 4 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ footer:
# Powered by Hexo & NexT
powered: true

# Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, http://www.beian.gov.cn
# Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, https://beian.mps.gov.cn
beian:
enable: false
icp:
# The digit in the num of gongan beian.
gongan_id:
# The full num of gongan beian.
gongan_num:
# The icon for gongan beian. See: http://www.beian.gov.cn/portal/download
# The icon for gongan beian. Login and See: https://beian.mps.gov.cn/web/business/businessHome/website
gongan_icon_url:


Expand Down Expand Up @@ -770,6 +770,8 @@ google_analytics:
# By default, NexT will load an external gtag.js script on your site.
# If you only need the pageview feature, set the following option to true to get a better performance.
only_pageview: false
# only needed if you are using `only_pageview` mode, https://developers.google.com/analytics/devguides/collection/protocol/ga4
measure_protocol_api_secret:

# Baidu Analytics
# See: https://tongji.baidu.com
Expand Down
42 changes: 21 additions & 21 deletions _vendors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ anime:
integrity: sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=
fontawesome:
name: '@fortawesome/fontawesome-free'
version: 6.4.2
version: 6.5.1
file: css/all.min.css
alias: font-awesome
integrity: sha256-CTSx/A06dm1B063156EVh15m6Y67pAjZZaQc89LLSrU=
integrity: sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=
prism:
name: prismjs
version: 1.29.0
Expand Down Expand Up @@ -55,21 +55,21 @@ pjax:
integrity: sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=
fancybox_js:
name: '@fancyapps/ui'
version: 5.0.24
version: 5.0.33
file: dist/fancybox/fancybox.umd.js
alias: fancyapps-ui
integrity: sha256-oyhjPiYRWGXaAt+ny/mTMWOnN1GBoZDUQnzzgC7FRI4=
integrity: sha256-+2+qOqR8CKoHh/AsVR9k2qaDBKWjYNC2nozhYmv5j9k=
fancybox_css:
name: '@fancyapps/ui'
version: 5.0.24
version: 5.0.33
file: dist/fancybox/fancybox.css
alias: fancyapps-ui
integrity: sha256-vQkngPS8jiHHH0I6ABTZroZk8NPZ7b+MUReOFE9UsXQ=
integrity: sha256-gkQVf8UKZgQ0HyuxL/VnacadJ+D2Kox2TCEBuNQg5+w=
mediumzoom:
name: medium-zoom
version: 1.0.8
version: 1.1.0
file: dist/medium-zoom.min.js
integrity: sha256-7PhEpEWEW0XXQ0k6kQrPKwuoIomz8R8IYyuU1Qew4P8=
integrity: sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc=
lazyload:
name: lozad
version: 1.16.0
Expand Down Expand Up @@ -108,24 +108,24 @@ gitalk_css:
integrity: sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U=
firebase_app:
name: firebase
version: 10.4.0
version: 10.7.2
file: firebase-app-compat.js
integrity: sha256-kv9gfd+UUnUqqJ2d478LEHzOijuUbZOVdEkuXSMm4qM=
integrity: sha256-xdQCzG9qpUPD/bs/ZEI5cFbxep9Zp6F1VJm3d9ynNcw=
firebase_firestore:
name: firebase
version: 10.4.0
version: 10.7.2
file: firebase-firestore-compat.js
integrity: sha256-sS/hkEB7nn47hhc//PNKfXiRX2YMEe4rBqUIqEhMYA8=
integrity: sha256-T7LqKXz+9Heox++4MR5RWllW/F1mamRl5xZjMdejtoE=
algolia_search:
name: algoliasearch
version: 4.20.0
version: 4.22.1
file: dist/algoliasearch-lite.umd.js
integrity: sha256-DABVk+hYj0mdUzo+7ViJC6cwLahQIejFvC+my2M/wfM=
integrity: sha256-pxkGFjfnFWYGOtV9uhCWK/spKiGS0Z7gVDKYm39LyfM=
instant_search:
name: instantsearch.js
version: 4.57.0
version: 4.64.2
file: dist/instantsearch.production.min.js
integrity: sha256-foJtB+Wd0wvvK+VU3KO0/H6CjwSwJfB1RnWlgx0Ov9U=
integrity: sha256-/DLulTBQ8KQ7xGOs8mrQ6FgKsknJpjCGAjFhjfjc8yo=
local_search:
name: hexo-generator-searchdb
version: 1.4.1
Expand All @@ -138,9 +138,9 @@ pdfobject:
integrity: sha256-g2xji1rlE3KsGVClvuxTbcR0Kn2+wtQADSff2Tbb4zA=
mermaid:
name: mermaid
version: 10.5.0
version: 10.7.0
file: dist/mermaid.min.js
integrity: sha256-K7oJiQlDulzl24ZUFOywuYme1JqBBvQzK6m8qHjt9Gk=
integrity: sha256-TtLOdUA8mstPoO6sGvHIGx2ceXrrX4KgIItO06XOn8A=
animate_css:
name: animate.css
version: 3.1.1
Expand Down Expand Up @@ -169,11 +169,11 @@ creative_commons:
alias: creativecommons-vocabulary
wavedrom:
name: wavedrom
version: 3.3.0
version: 3.4.0
file: wavedrom.min.js
integrity: sha256-IRMDzTC+wK5stMucZ/XSXkeS5VNtxZ+/Bm8Mcqfoxdo=
integrity: sha256-psuqlelzklLSAoqBmPNNdyJw8msJdKgKpUFJZQlJJjo=
wavedrom_skin:
name: wavedrom
version: 3.3.0
version: 3.4.0
file: skins/default.js
integrity: sha256-fduc/Zszk5ezWws2uInY/ALWVmIrmV6VTgXbsYSReFI=
2 changes: 1 addition & 1 deletion layout/_partials/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="{{ url_for(theme.footer.beian.gongan_icon_url) }}" alt="">
{%- endif %}
{%- if theme.footer.beian.gongan_id and theme.footer.beian.gongan_num %}
{{- next_url('http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=' + theme.footer.beian.gongan_id, theme.footer.beian.gongan_num + ' ') }}
{{- next_url('https://beian.mps.gov.cn/#/query/webSearch?code=' + theme.footer.beian.gongan_id, theme.footer.beian.gongan_num + ' ') }}
{%- endif %}
</div>
{%- endif %}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-next",
"version": "8.18.2",
"version": "8.19.1",
"description": "Elegant and powerful theme for Hexo.",
"main": "package.json",
"files": [
Expand Down Expand Up @@ -35,12 +35,12 @@
"@next-theme/eslint-config": "0.0.3",
"c8": "8.0.1",
"chai": "4.3.10",
"eslint": "8.51.0",
"hexo": "6.3.0",
"hexo-renderer-marked": "6.1.1",
"eslint": "8.55.0",
"hexo": "7.0.0",
"hexo-renderer-marked": "6.2.0",
"js-yaml": "4.1.0",
"mocha": "10.2.0",
"stylelint": "15.10.3",
"stylelint-stylus": "0.18.0"
"stylelint": "15.11.0",
"stylelint-stylus": "1.0.0"
}
}
4 changes: 2 additions & 2 deletions scripts/events/lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module.exports = hexo => {
config.highlight.hljs = false;
config.prismjs = config.prismjs || {};
theme.highlight = {
enable: config.highlight.enable && !config.prismjs.enable,
enable: config.syntax_highlighter === 'highlight.js' || config.highlight.enable,
light : highlightTheme(theme.codeblock.theme.light),
dark : highlightTheme(theme.codeblock.theme.dark)
};
theme.prism = {
enable: config.prismjs.enable,
enable: config.syntax_highlighter === 'prismjs' || config.prismjs.enable,
light : prismTheme(theme.codeblock.prism.light),
dark : prismTheme(theme.codeblock.prism.dark),
number: resolve('prismjs', 'plugins/line-numbers/prism-line-numbers.css')
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/next-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ hexo.extend.helper.register('next_config', function() {
comments : theme.comments,
stickytabs: theme.tabs.sticky,
motion : theme.motion,
prism : config.prismjs.enable && !config.prismjs.preprocess,
prism : theme.prism.enable && !config.prismjs.preprocess,
i18n : {
placeholder: __('search.placeholder'),
empty : __('search.empty', '${query}'),
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/next-vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
hexo.extend.helper.register('js_vendors', function() {
const { config, theme } = this;
const vendors = ['anime'];
if (config.prismjs.enable && !config.prismjs.preprocess) {
if (theme.prism.enable && !config.prismjs.preprocess) {
vendors.push('prism', 'prism_autoloader');
if (config.prismjs.line_number) {
vendors.push('prism_line_numbers');
Expand Down
32 changes: 25 additions & 7 deletions source/js/third-party/analytics/google-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,31 @@ if (!CONFIG.google_analytics.only_pageview) {
if (CONFIG.hostname !== location.hostname) return;
const uid = localStorage.getItem('uid') || (Math.random() + '.' + Math.random());
localStorage.setItem('uid', uid);
navigator.sendBeacon('https://www.google-analytics.com/collect', new URLSearchParams({
v : 1,
tid: CONFIG.google_analytics.tracking_id,
cid: uid,
t : 'pageview',
dp : encodeURIComponent(location.pathname)
}));
fetch(
'https://www.google-analytics.com/mp/collect?' + new URLSearchParams({
api_secret : CONFIG.google_analytics.measure_protocol_api_secret,
measurement_id: CONFIG.google_analytics.tracking_id
}),
{
method : 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_id: uid,
events : [
{
name : 'page_view',
params: {
page_location: location.href,
page_title : document.title
}
}
]
}),
mode: 'no-cors'
}
);
};
document.addEventListener('pjax:complete', sendPageView);
sendPageView();
Expand Down
3 changes: 3 additions & 0 deletions source/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ NexT.utils = {
box = document.createElement('div');
box.className = 'code-container';
container.wrap(box);

// add "notranslate" to prevent Google Translate from translating it, which also completely messes up the layout
box.classList.add('notranslate');
}
target = box;
}
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/next-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('next-url', () => {

before(() => {
hexo.config.url = 'https://example.com';
hexo.url_for = require('hexo/lib/plugins/helper/url_for').bind(hexo);
hexo.url_for = require('hexo/dist/plugins/helper/url_for').bind(hexo);
});

it('text', () => {
Expand Down

0 comments on commit 4e48524

Please sign in to comment.