ppoffice / hexo-theme-minos

A simple and retro styled Hexo theme, concentrated more on your ideas.
http://ppoffice.github.io/hexo-theme-minos
MIT License
768 stars 200 forks source link

Insight search always include self-made 404 page. #91

Closed novate closed 5 years ago

novate commented 5 years ago

Hi everyone, I have a self-made 404 page for my blogsite, however the insight search always include this 404 page as "Pages". I have checked the documentation of insight search, which let me to add indexing: false to the front. I tried that, but without help. Does anyone face the same problem? Do you know how to solve that.

大家好!我给自己的Github Pages做了一个diy的404页面,但是在insight搜索里面总是出现这个404页面,我不想让它在搜索框出现,请问有没有遇到这个问题的大神有解决方案呢?

ppoffice commented 5 years ago

@novate Actually insight search does not allow users to exclude any pages right now. However, you can try to change the following line in lib/i18n.js to see if it works.

-           return lang === language || (isDefaultLanguage(language) && !lang);
+           return lang === language || post.indexing !== false || (isDefaultLanguage(language) && !lang);
novate commented 5 years ago

@ppoffice Thank you, it works if I modify as below:

-           return lang === language || (isDefaultLanguage(language) && !lang);
+          return lang === language || (isDefaultLanguage(language) && !lang) && post.indexing !== false;

Can I issue a PR?

ppoffice commented 5 years ago

@novate Of course. You are welcome to contribute.