diff --git a/VERSION b/VERSION index 99523d4..689f7fb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.5.1 \ No newline at end of file +4.5.2 \ No newline at end of file diff --git a/data/config.yaml b/data/config.yaml index 3a98fbe..8d405bd 100644 --- a/data/config.yaml +++ b/data/config.yaml @@ -1,5 +1,5 @@ # Hugo NexT theme's custom config -version: 4.5.1 +version: 4.5.2 domain: hugo-next.eu.org \ No newline at end of file diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index ca01d80..e15c471 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -470,6 +470,7 @@ params: # 开启文章头部元素显示 # Post meta display settings postMeta: + # 是否开启各元素的文字显示 itemText: true created: true updated: @@ -822,8 +823,6 @@ params: # Waline comments system # More info seee: https://waline.js.org/ waline: - pageView: true - comment: true placeholder: "请文明发言哟 ヾ(≧▽≦*)o" sofa: "快来发表你的意见吧 (≧∀≦)ゞ" emoji: false @@ -964,6 +963,9 @@ params: indexName: # hits: perPage: 10 + # 索引生成内容长度字数限制 + # Index generation content length word count limit. + limit: 1000 # 本地搜索 # Local Search @@ -987,6 +989,9 @@ params: # 页面加载时是否要重新载入索引文件 # Preload the search data when the page loads. preload: false + # 索引生成内容长度字数限制 + # Index generation content length word count limit. + limit: 1000 # --------------------------------------------------------------- @@ -1103,7 +1108,6 @@ params: # --------------------------------------------------------------- vendors: - vendors: # The CDN provider of NexT internal scripts. # Available values: local | unpkg | cdnjs | qiniu | bootcdn | custom # Warning: If you are using the latest master branch of NexT, please set `internal: local` diff --git a/layouts/_default/list.algoliaindexes.json b/layouts/_default/list.algoliaindexes.json index f013cf8..2dc08eb 100644 --- a/layouts/_default/list.algoliaindexes.json +++ b/layouts/_default/list.algoliaindexes.json @@ -1,3 +1,4 @@ +{{ $limit := .Site.Params.algoliaSearch.limit | default 1000 }} [ {{ range $index, $entry := where .Site.RegularPages "Kind" "page" }} {{ if $index }}, {{ end }} @@ -5,7 +6,11 @@ "objectID": "{{ .Date.Unix }}", "permalink": "{{ .Permalink | relURL }}", "title": {{ .Title | jsonify }}, + {{ if gt .WordCount $limit }} + "content": {{ .Plain | truncate $limit | jsonify | safeJS }}, + {{ else }} "content": {{ .Plain | jsonify | safeJS }}, + {{ end }} "date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }}, "updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }} } diff --git a/layouts/_default/list.localindexes.xml b/layouts/_default/list.localindexes.xml index 9cd1326..a1f420f 100644 --- a/layouts/_default/list.localindexes.xml +++ b/layouts/_default/list.localindexes.xml @@ -1,3 +1,4 @@ +{{ $limit := .Site.Params.localSearch.limit | default 1000 }} {{ printf "" | safeHTML }} {{range where .Site.RegularPages "Kind" "page"}} @@ -12,7 +13,7 @@ {{ . }} {{ end }} - + {{ end }} \ No newline at end of file