hexo☞本地搜索

阅读量: zyh 2020-05-18 12:11:17
Categories: Tags:

前言

安装完 hexo-generator-search 后,发现搜索结果始终是所有文章.

如果你用的也是 Melody 主题,那么可以参考如下信息,来确认。

效果图

image-20200518121421437

软件包

截至:2020.05.18,软件包如下

  "dependencies": {
    "gitalk": "^1.6.2",
    "hexo": "^4.0.0",
    "hexo-asset-image": "^1.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-search": "^2.4.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-pug": "^1.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    "react": "^15.3.1",
    "react-dom": "^15.3.1"
  }

_config.yml

追加内容如下

search:
  path: search.xml
  field: post
  content: true

主题配置

修改内容

local_search:
  enable: true