iblh / hexo-theme-material

Material Design theme for hexo.
https://iblh.github.io/material-demo/
GNU General Public License v3.0
4.03k stars 564 forks source link

local search无法使用 #397

Open Jimmy9876 opened 7 years ago

Jimmy9876 commented 7 years ago

I certify that I have first consulted (check all with "x")

我确认我已经查看了 (使用 "x" 选择)


I'm submitting a (check one with "x")

我正在申请 (使用 "x" 选择)

local seach无法使用,确认已经安装了localsearch插件,且站点配置文件正确,主题配置文件已改为search: local,但是搜索时无反应

neoFelhz commented 7 years ago

Could you please give us a demo?

neoFelhz commented 7 years ago

OK, I visit the http://jimmy9876.top/, and when I click the search button , the search.xml get normally. I think may be something wrong with the search.xml your generated.

Jimmy9876 commented 7 years ago

I check the search.xml,find no error, and if I hexo init a new blog, then download a new material theme, it works?why? And if I set

search:
    path: search.xml
    field: all

it has errors, but

search:
    path: search.xml
    field: post

have no error...

Jimmy9876 commented 7 years ago

the error message when I hexo generate:

FATAL ejs:16
    14|       </categories>
    15| <% } -%>
 >> 16| <% if(post.tags&&post.tags.length>0){ -%>
    17|       <tags>
    18| <% post.tags.each(function (tag) { -%>
    19|         <tag><%= tag.name %></tag>

post is not defined
wangxiaoyao commented 7 years ago

1 请确保你search.xml 可以正常显示。否则无法进行搜索 2 可能原因: 不要在markdown中写代码!! 3 hexo博客搭建 自行搜索下

crown3 commented 7 years ago

@wangxiaoyao 在博客中插入代码块后会造成生成search.xml错误?

jianlei commented 6 years ago

使用vim查看一下markdown中是否有非utf8的字符,我这里就是这个问题。 @crown3