mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-03 22:22:00 +08:00
feat: 更新 lazyload 配置,支持原生 lazyload 功能
feat: 代碼優化 feat: 優化 pageType 邏輯 fix: 修復解密文章後, chartjs 沒有加載的 bug
This commit is contained in:
1 parent
f7483d59b5
commit
247c1b664d
37 files changed
+110
-104
No files matched your search
@@ -11,7 +11,7 @@ div
|
|||||||
if theme.instantpage
|
if theme.instantpage
|
||||||
script(src=url_for(theme.asset.instantpage), type='module')
|
script(src=url_for(theme.asset.instantpage), type='module')
|
||||||
|
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable && !theme.lazyload.native
|
||||||
script(src=url_for(theme.asset.lazyload))
|
script(src=url_for(theme.asset.lazyload))
|
||||||
|
|
||||||
if theme.snackbar.enable
|
if theme.snackbar.enable
|
||||||
@@ -33,7 +33,7 @@ div
|
|||||||
!= partial("includes/third-party/prismjs", {}, { cache: true })
|
!= partial("includes/third-party/prismjs", {}, { cache: true })
|
||||||
|
|
||||||
if theme.aside.enable && theme.aside.card_newest_comments.enable
|
if theme.aside.enable && theme.aside.card_newest_comments.enable
|
||||||
if theme.pjax.enable || (!is_post() && page.aside !== false)
|
if theme.pjax.enable || (globalPageType !== 'post' && page.aside !== false)
|
||||||
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
||||||
|
|
||||||
!= fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
!= fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
- var pageTitle
|
- var pageTitle
|
||||||
- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : ''
|
- globalPageType === 'archive' ? page.title = findArchivesTitle(page, theme.menu, date) : ''
|
||||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
case globalPageType
|
||||||
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
when 'tag'
|
||||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404')
|
- pageTitle = _p('page.tag') + ': ' + page.tag
|
||||||
- else pageTitle = page.title || config.title || ''
|
when 'category'
|
||||||
|
- pageTitle = _p('page.category') + ': ' + page.category
|
||||||
|
when '404'
|
||||||
|
- pageTitle = _p('error404')
|
||||||
|
default
|
||||||
|
- pageTitle = page.title || config.title || ''
|
||||||
|
|
||||||
|
|
||||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||||
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
- var tabTitle = globalPageType === 'home' || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||||
- var pageCopyright = config.copyright || config.author
|
- var pageCopyright = config.copyright || config.author
|
||||||
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
|
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ if theme.Open_Graph_meta.enable
|
|||||||
-
|
-
|
||||||
const coverVal = page.cover_type === 'img' ? page.cover : theme.avatar.img
|
const coverVal = page.cover_type === 'img' ? page.cover : theme.avatar.img
|
||||||
let ogOption = Object.assign({
|
let ogOption = Object.assign({
|
||||||
type: is_post() ? 'article' : 'website',
|
type: globalPageType === 'post' ? 'article' : 'website',
|
||||||
image: coverVal ? full_url_for(coverVal) : '',
|
image: coverVal ? full_url_for(coverVal) : '',
|
||||||
fb_admins: theme.facebook_comments.user_id || '',
|
fb_admins: theme.facebook_comments.user_id || '',
|
||||||
fb_app_id: theme.facebook_comments.app_id || '',
|
fb_app_id: theme.facebook_comments.app_id || '',
|
||||||
|
|||||||
Loaded 3 of 37 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user