hexo-theme-next
Advanced tools
Comparing version 8.2.1 to 8.2.2-beta.0
{ | ||
"name": "hexo-theme-next", | ||
"version": "8.2.1", | ||
"version": "8.2.2-beta.0", | ||
"description": "Elegant and powerful theme for Hexo.", | ||
@@ -17,2 +17,3 @@ "main": "package.json", | ||
"eslint": "eslint scripts/ source/js test/", | ||
"prepare": "git config --local core.hooksPath .githooks/", | ||
"stylint": "stylint source/css/", | ||
@@ -39,12 +40,6 @@ "test": "mocha test/index.js" | ||
"hexo-renderer-marked": "3.3.0", | ||
"husky": "4.3.8", | ||
"js-yaml": "4.0.0", | ||
"mocha": "8.2.1", | ||
"stylint": "2.0.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run eslint && npm test" | ||
} | ||
} | ||
} |
@@ -16,2 +16,4 @@ /* global hexo */ | ||
const siteHost = parse(config.url).hostname || config.url; | ||
// External URL icon | ||
const exturlIcon = theme.exturl_icon ? '<i class="fa fa-external-link-alt"></i>' : ''; | ||
data.content = data.content.replace(/<a[^>]* href="([^"]+)"[^>]*>([^<]+)<\/a>/img, (match, href, html) => { | ||
@@ -25,3 +27,7 @@ // Exit if the href attribute doesn't exists. | ||
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}">${html}<i class="fa fa-external-link-alt"></i></span>`; | ||
// Return encrypted URL with title. | ||
const title = match.match(/title="([^"]+)"/); | ||
if (title) return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}" title="${title[1]}">${html}${exturlIcon}</span>`; | ||
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}">${html}${exturlIcon}</span>`; | ||
}); | ||
@@ -28,0 +34,0 @@ } |
@@ -21,7 +21,8 @@ /* global hexo */ | ||
const { internal } = this.theme.vendors; | ||
const minified_file = file.endsWith('.js') && !file.endsWith('.min.js') ? file.slice(0, -3) + '.min.js' : file; | ||
const links = { | ||
local : this.url_for(`${this.theme.js}/${file}`), | ||
jsdelivr: `https://cdn.jsdelivr.net/npm/hexo-theme-next@${next_version}/source/js/${file}`, | ||
jsdelivr: `https://cdn.jsdelivr.net/npm/hexo-theme-next@${next_version}/source/js/${minified_file}`, | ||
unpkg : `https://unpkg.com/hexo-theme-next@${next_version}/source/js/${file}`, | ||
cdnjs : `https://cdnjs.cloudflare.com/ajax/libs/hexo-theme-next/${next_version}/${file}` | ||
cdnjs : `https://cdnjs.cloudflare.com/ajax/libs/hexo-theme-next/${next_version}/${minified_file}` | ||
}; | ||
@@ -28,0 +29,0 @@ const src = links[internal] || links.local; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
493919
8
2244
1