diff --git a/_config.yml b/_config.yml index 6b4b047..9ce251e 100755 --- a/_config.yml +++ b/_config.yml @@ -63,10 +63,11 @@ article: search: service: local_search # local_search, todo... - local_search: + local_search: # 在 front-matter 中设置 indexing:false 来避免被搜索索引 field: all # post, page, all - path: /search.json - content: true + path: /search.json # 搜索文件存放位置 + content: true # 是否搜索内容 + codeblock: true # 是否搜索代码块(需要content: true) ######## Comments ######## diff --git a/layout/_partial/sidebar/index.ejs b/layout/_partial/sidebar/index.ejs index 1fd13b2..cbfd48c 100755 --- a/layout/_partial/sidebar/index.ejs +++ b/layout/_partial/sidebar/index.ejs @@ -83,7 +83,7 @@ function layoutWidgets() { if (name in theme.data.widgets) { Object.assign(widget, theme.data.widgets[name]) } - if (typeof w == 'object' && w.override) { + if (typeof w == 'object' && (w.override || w.layout)) { Object.assign(widget, w) } if (widget && widget.layout) { diff --git a/layout/_partial/widgets/search.ejs b/layout/_partial/widgets/search.ejs index 438f5ef..3fbfce4 100644 --- a/layout/_partial/widgets/search.ejs +++ b/layout/_partial/widgets/search.ejs @@ -5,15 +5,23 @@ function layoutDiv() { el += '