This commit is contained in:
amehime
2020-09-18 00:12:22 +08:00
parent 2fd519f453
commit a98f6e8409
2 changed files with 21 additions and 2 deletions

View File

@@ -161,6 +161,25 @@ autoprefixer:
缺少这个插件,首页卡片翻转效果在部分浏览器中无法正确显示。
## algolia配置建议
```yml
algolia:
appId: #Your appId
apiKey: #Your apiKey
adminApiKey: #Your adminApiKey
chunkSize: 5000
indexName: #"shoka"
fields:
- categories
- content:strip:truncate,0,2000
- gallery
- path
- photos
- tags
- title
```
## feed配置建议
```yml

View File

@@ -407,8 +407,8 @@ const algoliaSearch = function(pjax) {
container: '#search-hits',
templates: {
item: function(data) {
var cats = data.categories.join('<i class="ic i-angle-right"></i>')
return '<a href="' + CONFIG.root + data.path +'"><span>'+cats+'</span>'+data._highlightResult.title.value+'</a>';
var cats = data.categories ? '<span>'+data.categories.join('<i class="ic i-angle-right"></i>')+'</span>' : '';
return '<a href="' + CONFIG.root + data.path +'">'+cats+data._highlightResult.title.value+'</a>';
},
empty: function(data) {
return '<div id="hits-empty">'+