mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
💥 支持雙評論系統配置/評論配置整理
✨ 增加mac light 代碼框 ✨ 增加文章過期提醒配置 ✨ 文章copyright 可單獨配置 ✨ card-category 中category名稱和數字限制一行顯示 ✨ 簡繁轉換優化,placeholder文字也會被轉換 🐛 修復配置PWA參數時,如果網站是子目錄時,會出現加載不到文件的bugs 調整當card-category有收縮按鈕時的顯示佈局
This commit is contained in:
@@ -13,7 +13,7 @@ $(function () {
|
||||
})
|
||||
})
|
||||
|
||||
var closeSearch = function () {
|
||||
const closeSearch = function () {
|
||||
$('body').css('width', '')
|
||||
$('body').css('overflow', '')
|
||||
$('.search-dialog').css({
|
||||
@@ -33,13 +33,13 @@ $(function () {
|
||||
}
|
||||
$('.search-mask, .search-close-button').on('click touchstart', closeSearch)
|
||||
|
||||
var algolia = GLOBAL_CONFIG.algolia
|
||||
var isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
|
||||
const algolia = GLOBAL_CONFIG.algolia
|
||||
const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
|
||||
if (!isAlgoliaValid) {
|
||||
return console.error('Algolia setting is invalid!')
|
||||
}
|
||||
|
||||
var search = instantsearch({
|
||||
const search = instantsearch({
|
||||
appId: algolia.appId,
|
||||
apiKey: algolia.apiKey,
|
||||
indexName: algolia.indexName,
|
||||
@@ -47,7 +47,7 @@ $(function () {
|
||||
hitsPerPage: algolia.hits.per_page || 10
|
||||
},
|
||||
searchFunction: function (helper) {
|
||||
var searchInput = $('#algolia-search-input').find('input')
|
||||
const searchInput = $('#algolia-search-input').find('input')
|
||||
|
||||
if (searchInput.val()) {
|
||||
helper.search()
|
||||
@@ -68,7 +68,7 @@ $(function () {
|
||||
container: '#algolia-hits',
|
||||
templates: {
|
||||
item: function (data) {
|
||||
var link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
|
||||
const link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
|
||||
return (
|
||||
'<a href="' + link + '" class="algolia-hit-item-link">' +
|
||||
data._highlightResult.title.value +
|
||||
@@ -94,7 +94,7 @@ $(function () {
|
||||
container: '#algolia-stats',
|
||||
templates: {
|
||||
body: function (data) {
|
||||
var stats = GLOBAL_CONFIG.algolia.languages.hits_stats
|
||||
const stats = GLOBAL_CONFIG.algolia.languages.hits_stats
|
||||
.replace(/\$\{hits}/, data.nbHits)
|
||||
.replace(/\$\{time}/, data.processingTimeMS)
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user