mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:30:53 +08:00
breaking changes: algolia 升級至 v4
feat: 本地搜索增加數據庫加載中和搜索中 loading 顯示 feat: 更改文章美化後,列表的顯示效果 closed #693 closed #686 improvement: UI 微調
This commit is contained in:
@@ -33,8 +33,8 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
// search
|
||||
local_search: '/js/search/local-search.js',
|
||||
algolia_js: '/js/search/algolia.js',
|
||||
algolia_search: 'https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js',
|
||||
algolia_search_css: 'https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css',
|
||||
algolia_search_v4: 'https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js',
|
||||
instantsearch_v4: 'https://cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js',
|
||||
|
||||
// math
|
||||
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js',
|
||||
@@ -57,8 +57,8 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
pangu: 'https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js',
|
||||
|
||||
// photo
|
||||
fancybox_css: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css',
|
||||
fancybox: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js',
|
||||
fancybox_css_v4: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css',
|
||||
fancybox_v4: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js',
|
||||
medium_zoom: 'https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js',
|
||||
|
||||
// snackbar
|
||||
|
||||
@@ -18,10 +18,4 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
process.exit(-1)
|
||||
}
|
||||
}
|
||||
|
||||
// let stylus to get the hexo highlight config
|
||||
const themeConfig = hexo.theme.config
|
||||
const hexoConfig = hexo.config
|
||||
themeConfig.highlight_settings = hexoConfig.highlight
|
||||
themeConfig.prismjs_settings = hexoConfig.prismjs
|
||||
})
|
||||
|
||||
15
scripts/events/stylus.js
Normal file
15
scripts/events/stylus.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* stylus
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.filter.register('stylus:renderer', function (style) {
|
||||
const { highlight, prismjs } = hexo.config
|
||||
style
|
||||
.define('$highlight_enable', highlight && highlight.enable)
|
||||
.define('$highlight_line_number', highlight && highlight.line_number)
|
||||
.define('$prismjs_enable', prismjs && prismjs.enable)
|
||||
.define('$prismjs_line_number', prismjs && prismjs.line_number)
|
||||
// .import(this.source_dir.replace(/\\/g, '/') + '_data/css/*')
|
||||
})
|
||||
Reference in New Issue
Block a user