Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions scripts/helpers/next-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

'use strict';

const { parse } = require('url');

/**
* Export theme config
*/
hexo.extend.helper.register('next_config', function() {
const { config, theme, url_for, __ } = this;
let hostname = config.url;

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

The initial value of hostname is unused, since it is always overwritten.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
try {
hostname = new URL(config.url).hostname || config.url;
} catch (_) {

Check failure on line 13 in scripts/helpers/next-config.js

View workflow job for this annotation

GitHub Actions / linter

'_' is defined but never used
hostname = config.url;
}
const exportConfig = {
hostname : parse(config.url).hostname || config.url,
hostname,
root : config.root,
images : url_for(theme.images),
scheme : theme.scheme,
Expand Down
Loading