hexo github环境 generateh和deploy出问题怎么回事?
大神们在线等
在这之前尝试让Google 百度录取网站,然后
下载了谷歌百度的验证文件放在这里
安装教程上面的说明(这是教程地址:https://www.cnblogs.com/tengj...)
然后部署到服务器,输入地址:http://你的域名/googlead0e226... 能访问到就可以点验证按钮。
结果不行
我就不管了
就安装教程继续
分别用下面两个命令来安装针对谷歌和百度的插件
npm install hexo-generator-sitemap --save
npm install hexo-generator-baidu-sitemap --save
再之后
在博客目录的_config.yml中添加如下代码
# 自动生成sitemap
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml
然后他说编译你的博客
hexo g
就报错了
下面是报错代码
FATAL duplicated mapping key at line 93, column 1:
path: baidusitemap.xml
^
YAMLException: duplicated mapping key at line 93, column 1:
path: baidusitemap.xml
^
at generateError (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:165:10)
at throwError (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:171:9)
at storeMappingPair (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:308:7)
at readBlockMapping (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:1071:9)
at composeNode (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:1332:12)
at readDocument (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:1492:3)
at loadDocuments (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:1548:5)
at Object.load (C:\网站\node_modules\js-yaml\lib\js-yaml\loader.js:1569:19)
at Hexo.yamlHelper (C:\网站\node_modules\hexo\lib\plugins\renderer\yaml.js:7:15)
at Hexo.tryCatcher (C:\网站\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (C:\网站\node_modules\bluebird\js\release\method.js:15:34)
at Promise.then.text (C:\网站\node_modules\hexo\lib\hexo\render.js:61:21)
at tryCatcher (C:\网站\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\网站\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\网站\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\网站\node_modules\bluebird\js\release\promise.js:614:10)
然后我发现原因是path: baidusitemap.xml就把这几句删掉了
但是hexo g 之后又报错
$ hexo generate
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: ejs:13
11| <title><%-: post.title %></title>
12| <pubTime><%= post.date.toDate().toISOString() %></pubTime>
13| <%if(post.tags){ post.tags.toArray().forEach(function(tag){ %>
14| <tag><%= tag.name %></tag>
15| <% })}/*%>
16| <content><%-: post.content%></content>
post.tags.toArray is not a function
at eval (eval at exports.compile (C:\网站\node_modules\hexo-generator-baidu-sitemap\node_modules\ejs\lib\ejs.js:242:14), <anonymous>:30:767)
at Array.forEach (<anonymous>)
at eval (eval at exports.compile (C:\网站\node_modules\hexo-generator-baidu-sitemap\node_modules\ejs\lib\ejs.js:242:14), <anonymous>:30:211)
at eval (eval at exports.compile (C:\网站\node_modules\hexo-generator-baidu-sitemap\node_modules\ejs\lib\ejs.js:242:14), <anonymous>:30:1600)
at C:\网站\node_modules\hexo-generator-baidu-sitemap\node_modules\ejs\lib\ejs.js:255:15
at Hexo.module.exports (C:\网站\node_modules\hexo-generator-baidu-sitemap\lib\generator.js:19:13)
at Hexo.tryCatcher (C:\网站\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (C:\网站\node_modules\bluebird\js\release\method.js:15:34)
at Promise.map.key (C:\网站\node_modules\hexo\lib\hexo\index.js:336:26)
at tryCatcher (C:\网站\node_modules\bluebird\js\release\util.js:16:23)
at MappingPromiseArray._promiseFulfilled (C:\网站\node_modules\bluebird\js\release\map.js:61:38)
at MappingPromiseArray.PromiseArray._iterate (C:\网站\node_modules\bluebird\js\release\promise_array.js:114:31)
at MappingPromiseArray.init (C:\网站\node_modules\bluebird\js\release\promise_array.js:78:10)
at MappingPromiseArray._asyncInit (C:\网站\node_modules\bluebird\js\release\map.js:30:10)
at Async._drainQueue (C:\网站\node_modules\bluebird\js\release\async.js:138:12)
at Async._drainQueues (C:\网站\node_modules\bluebird\js\release\async.js:143:10)
求大神解决一下。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论