hexo-theme-next
Advanced tools
Comparing version 8.7.0 to 8.7.1
@@ -147,2 +147,4 @@ <div align="right"> | ||
- `i18n`: 更新了翻译的 Pull Request | ||
- `Dependencies`: 更新了依赖包的 Pull Request | ||
- `Actions`: 更新了 GitHub Actions 的 Pull Request | ||
- `Skip Release`: 无需在 Release Note 中展现的 Pull Request | ||
@@ -154,8 +156,6 @@ | ||
- `Help Wanted`: 需要帮助的 Issue 或者 Pull Request | ||
- `Discussion`: 需要进行讨论的 Issue 或者 Pull Request | ||
- `Improvement`: 需要改进的 Issue 或者改进了 NexT 主题的 Pull Request | ||
- `Performance`: 提出性能问题的 Issue 或者提高了 NexT 主题性能的 Pull Request | ||
- `Layout`: 与模版引擎相关的 Issue 或者 Pull Request | ||
- `CSS`: 与 NexT 主题 CSS 文件相关的 Issue 或者 Pull Request | ||
- `Fonts`: 与 NexT 主题字体相关的 Issue 或者 Pull Request | ||
- `Icons & Fonts`: 与 NexT 主题图标和字体相关的 Issue 或者 Pull Request | ||
- `PJAX`: 与 PJAX 相关的 Issue 或者 Pull Request | ||
@@ -162,0 +162,0 @@ - `3rd Party Plugin`: 与第三方插件和服务相关的 Issue 或者 Pull Request |
{ | ||
"name": "hexo-theme-next", | ||
"version": "8.7.0", | ||
"version": "8.7.1", | ||
"description": "Elegant and powerful theme for Hexo.", | ||
@@ -39,5 +39,5 @@ "main": "package.json", | ||
"hexo": "5.4.0", | ||
"hexo-renderer-marked": "4.0.0", | ||
"hexo-renderer-marked": "4.1.0", | ||
"js-yaml": "4.1.0", | ||
"mocha": "9.0.3", | ||
"mocha": "9.1.1", | ||
"nyc": "15.1.0", | ||
@@ -44,0 +44,0 @@ "stylint": "2.0.0" |
@@ -17,3 +17,3 @@ 'use strict'; | ||
module.exports = hexo => { | ||
const { vendors, creative_commons } = hexo.theme.config; | ||
const { vendors, creative_commons, pace } = hexo.theme.config; | ||
if (typeof internal === 'function') { | ||
@@ -34,2 +34,5 @@ internal(hexo, dependencies); | ||
} | ||
if (key === 'pace_css') { | ||
value.file = `${value.dir}/${pace.color}/pace-theme-${pace.theme}.css`; | ||
} | ||
const { name, version, file, alias, unavailable } = value; | ||
@@ -36,0 +39,0 @@ const links = { |
@@ -136,4 +136,4 @@ /* global hexo */ | ||
// Others | ||
if (!theme.nprogress.enable) { | ||
hexo.route.remove('js/third-party/nprogress.js'); | ||
if (!theme.fancybox) { | ||
hexo.route.remove('js/third-party/fancybox.js'); | ||
} | ||
@@ -140,0 +140,0 @@ |
@@ -22,3 +22,2 @@ /* global hexo */ | ||
bookmark : theme.bookmark, | ||
fancybox : theme.fancybox, | ||
mediumzoom: theme.mediumzoom, | ||
@@ -25,0 +24,0 @@ lazyload : theme.lazyload, |
@@ -66,3 +66,2 @@ /* global NexT, CONFIG */ | ||
CONFIG.prism && window.Prism.highlightAll(); | ||
CONFIG.fancybox && NexT.utils.wrapImageWithFancyBox(); | ||
CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', { | ||
@@ -69,0 +68,0 @@ background: 'var(--content-bg-color)' |
@@ -34,4 +34,4 @@ /* global NexT, CONFIG, MathJax */ | ||
MathJax.texReset(); | ||
MathJax.typeset(); | ||
MathJax.typesetPromise(); | ||
} | ||
}); |
@@ -34,37 +34,2 @@ /* global NexT, CONFIG */ | ||
/** | ||
* Wrap images with fancybox. | ||
*/ | ||
wrapImageWithFancyBox: function() { | ||
document.querySelectorAll('.post-body :not(a) > img, .post-body > img').forEach(element => { | ||
const $image = $(element); | ||
const imageLink = $image.attr('data-src') || $image.attr('src'); | ||
const $imageWrapLink = $image.wrap(`<a class="fancybox fancybox.image" href="${imageLink}" itemscope itemtype="http://schema.org/ImageObject" itemprop="url"></a>`).parent('a'); | ||
if ($image.is('.post-gallery img')) { | ||
$imageWrapLink.attr('data-fancybox', 'gallery').attr('rel', 'gallery'); | ||
} else if ($image.is('.group-picture img')) { | ||
$imageWrapLink.attr('data-fancybox', 'group').attr('rel', 'group'); | ||
} else { | ||
$imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default'); | ||
} | ||
const imageTitle = $image.attr('title') || $image.attr('alt'); | ||
if (imageTitle) { | ||
$imageWrapLink.append(`<p class="image-caption">${imageTitle}</p>`); | ||
// Make sure img title tag will show correctly in fancybox | ||
$imageWrapLink.attr('title', imageTitle).attr('data-caption', imageTitle); | ||
} | ||
}); | ||
$.fancybox.defaults.hash = false; | ||
$('.fancybox').fancybox({ | ||
loop : true, | ||
helpers: { | ||
overlay: { | ||
locked: false | ||
} | ||
} | ||
}); | ||
}, | ||
registerExtURL: function() { | ||
@@ -71,0 +36,0 @@ document.querySelectorAll('span.exturl').forEach(element => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
442879
3032