fix(post-tools): fixed bug where post tools does not show
This commit is contained in:
parent
5536e3db17
commit
028b7eebd6
|
@ -30,12 +30,14 @@ const {
|
|||
<% } %>
|
||||
|
||||
<div class="post-scripts<%= theme.pjax?.enable === true ? ' pjax' : '' %>">
|
||||
<% if (t_toc?.enable === true && is_post()) { %>
|
||||
<% if (is_post()) { %>
|
||||
<%- __js([
|
||||
'js/post-helper.js',
|
||||
'js/toc.js',
|
||||
'js/libs/anime.min.js'
|
||||
]) %>
|
||||
<% if (t_toc?.enable === true) { %>
|
||||
<%- __js('js/toc.js') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ hexo.extend.helper.register('export_config', function () {
|
|||
side_tools: theme.side_tools || {},
|
||||
pjax: theme.pjax || {},
|
||||
lazyload: theme.lazyload || {},
|
||||
comment: theme.comment || {},
|
||||
version: require('../../package.json').version
|
||||
}
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
position fixed
|
||||
top $header-height + $component-spacing-value
|
||||
left 'calc((100vw - %s / 2) - 5rem)' % $content-max-width
|
||||
box-sizing border-box
|
||||
opacity 0
|
||||
transition-t("top, transform, opacity, left", "0, 0, 0.2, 0", "0.2, 0.2, 0.2, 0.2", "ease, ease, ease, ease")
|
||||
|
||||
|
|
|
@ -114,10 +114,14 @@ function initToggleShowToc() {
|
|||
observer.observe(commentsCountDom, config)
|
||||
}
|
||||
}
|
||||
KEEP.utils.postHelper.initToggleToc()
|
||||
KEEP.utils.postHelper.initSetPostToolsLeft()
|
||||
if (KEEP.theme_config.toc.enable === true) {
|
||||
KEEP.utils.postHelper.initToggleToc()
|
||||
}
|
||||
if (KEEP.theme_config.comment.enable === true) {
|
||||
KEEP.utils.postHelper.goToComments()
|
||||
KEEP.utils.postHelper.watchPostCommentsCount()
|
||||
}
|
||||
}
|
||||
|
||||
if (KEEP.theme_config.pjax.enable === true && KEEP.utils) {
|
||||
|
|
Loading…
Reference in New Issue