Commands: clean Remove generated files and cache. config Get or set configurations. deploy Deploy your website. generate Generate static files. help Get help on a command. init Create a new Hexo folder. list List the information of the site migrate Migrate your site from other system to Hexo. new Create a new post. publish Moves a draft post from _drafts to _posts folder. render Render files with renderer plugins. server Start the server. version Display version information. Global Options: --config Specify config file instead of using _config.yml --cwd Specify the CWD --debug Display all verbose messages in the terminal --draft Display draft posts --safe Disable all plugins and scripts --silent Hide output on console For more help, you can use 'hexo help [command]'for the detailed information or you can check the docs: http://hexo.io/docs/
原因:未安装hexo algolia插件 解决办法1:在hexo 项目根目录执行npm安装命令
1
npm install hexo-algolia --save
报错:Please set an HEXO_ALGOLIA_INDEXING_KEY environment variable to enable content indexing.
1 2
ERROR [hexo-algolia] Please set an `HEXO_ALGOLIA_INDEXING_KEY` environment variable to enable content indexing. ERROR >> Read https://npmjs.com/hexo-algolia#api-key for more informations.
INFO [hexo-algolia] Testing HEXO_ALGOLIA_INDEXING_KEY permissions. INFO Start processing INFO [hexo-algolia] 47 records to index (post, page). INFO [hexo-algolia] Indexing chunk 1 of 1 (47 records) ERROR [hexo-algolia] Method not allowed with this referer INFO [hexo-algolia] Indexing done.
原因:使用了查询API key环境变量中设置的密钥需要为Admin KEY
解决办法: 登录Algolia官网,进入api key控制台
复制Admin API Key 修改环境变量HEXO_ALGOLIA_INDEXING_KEY的值为该API Key即可 PS:__config.yml文件中配置的API密钥为搜索密钥(Search-Only API Key),请注意区分