coneycode / hexo-generator-baidu-sitemap Goto Github PK
View Code? Open in Web Editor NEWBaidu Sitemap generator plugin for Hexo
License: MIT License
Baidu Sitemap generator plugin for Hexo
License: MIT License
问一个hexo插件开发的问题? #6
@XuanmiaoG
XuanmiaoG opened this issue
about 1 hour ago
如何制作一个hexo 插件,在每个页面中都追加一段js代码?
@XuanmiaoG
XuanmiaoG
commented about 1 hour ago
希望给出代码
"dependencies": {
"ejs": "^1.0.0",
"hexo": "^3.0.0",
"hexo-generator-baidu-sitemap": "0.0.8",
"utils-merge": "^1.0.0"
},
为什么要依赖[email protected]. 这行代码是不是可以删除。否则会出现错误invalid: have [email protected]
hexo: 3.3.5
hexo-cli: 1.0.3
os: Windows_NT 6.1.7601 win32 x64
http_parser: 2.7.0
node: 7.10.1
v8: 5.5.372.43
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2k
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j
WX@WX-PC /d/hexo (master)
$ npm -v
4.2.0
$ npm list --depth=0
[email protected] d:\hexo
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
--- [email protected]
npm ERR! invalid: [email protected] d:\hexo\node_modules\hexo-g
enerator-baidu-sitemap\node_modules\hexo-generator-baidu-sitemap
这个原因是为啥呢?remove 0.0.8之后还是这样
我的是标题里面有&,在转成xml的时候应该变成实体命名。参考如下链接
https://blog.csdn.net/goon_star/article/details/49636505
希望能增加一下,把标题或者标签等里面有的特殊符号变成实体命名
npm install hexo-generator-baidu-sitemap --save-dev
成功。
然后,hexo d -g
报错。
谷歌搜索到有一位也是类似报错信息的 post.tags.toArray is not a function
。
但好像显示的又不太一样,他的解决措施我也没遇到类似的问题,无法通过他的解决方式解决...
rt
在hexo 3.1.1下,当同时使用hexo-generator-baidu-sitemap
和hexo-generator-sitemap
的时候,如果按照说明里的语法,配置文件缩进两空格的话,会导致baidusitemap.xml
无法生成。
如下:
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml
而当把配置项的空格缩进去掉的时候,就又正常了。
sitemap:
path: sitemap.xml
baidusitemap:
path: baidusitemap.xml
不知道其他人能不能重现。。如果可以的话建议说明里的配置项的空格缩进去掉。
搜索就不说了,单从百度站长页面就知道这个公司有多垃圾,跟谷歌差太远
你好,我最近使用 hexo 5 新搭建了一个blog,其url及注释是这样写的
# URL
## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/'
url: http://xxxxx/blog
root: /blog/
permalink: /posts/:title-:year-:month-:day.html
最终生成的 sitemap 链接如下:
http://xxxxx/blog/blog//post/:title-:year-:month-:day.html
是否需要在拼接时,校验 root 存在,防止重复拼接呢?
用了你的包,看了下,生成的都只是给post生成了url,可以把page也加上吗,谢谢
近期收到百度反馈:
【百度】【百度搜索资源平台】尊敬的搜索合作伙伴,您好!为了提升站点新资源的处理效率,避免旧数据过多造成站点数据抓取与处理异常,请于11月9日之前尽快删除超出站点配额的历史sitemap文件(包括普通收录与死链数据)。如到期未处理,系统将统一删除。感谢您的关注与支持!
提交sitemap显示存在无效URL
Hi, I am using hexo 3.6.0. According to your doc, I should config like this:
baidusitemap:
path: baidusitemap.xml
but after that, I ran hexo g
. Then, I checked out the public
directory and found that there are no file baidusitemap.xml
.
Did I use it in a wrong way?
当我把这个插件安装完之后,只需要在_config.yml添加
baidusitemap:
path: baidusitemap.xml
就可以了是啊?还需要添加其他的文件或者执行其他的命令吗
如果删除node_modules下的hexo-generator-baidu-sitemap 问题就好了
$ hexo s
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'count' of undefined
at Hexo.module.exports (I:\hexo\node_modules\hexo-baidu-url-submit\lib\generator.js:4:41)
at Hexo.tryCatcher (I:\hexo\node_modules\bluebird\js\release\util.js:16:23)
at Hexo. (I:\hexo\node_modules\bluebird\js\release\method.js:15:34)
at Promise.map.key (I:\hexo\node_modules\hexo\lib\hexo\index.js:318:20)
at tryCatcher (I:\hexo\node_modules\bluebird\js\release\util.js:16:23)
at MappingPromiseArray._promiseFulfilled (I:\hexo\node_modules\bluebird\js\release\map.js:61:38)
at MappingPromiseArray.PromiseArray._iterate (I:\hexo\node_modules\bluebird\js\release\promise_array.js:114:31)
at MappingPromiseArray.init (I:\hexo\node_modules\bluebird\js\release\promise_array.js:78:10)
at MappingPromiseArray._asyncInit (I:\hexo\node_modules\bluebird\js\release\map.js:30:10)
at _drainQueueStep (I:\hexo\node_modules\bluebird\js\release\async.js:142:12)
at _drainQueue (I:\hexo\node_modules\bluebird\js\release\async.js:131:9)
at Async._drainQueues (I:\hexo\node_modules\bluebird\js\release\async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (I:\hexo\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
如题,我的 baidusitemap.xml 文件在浏览器里打开时显示如下错误
This page contains the following errors:
error on line 167 at column 35: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
按照这个链接里的方法把某篇文章标题里的 &
改成 &
就好了,请问可不可以添加上这个字符编码的功能呢?
You can use my repository to reproduce this issue.
https://github.com/winterTTr/winterTTr.github.io/tree/hexo-content
Use the hero-content
branch of my repository and hero g
, baidusitemap.xml
does not generate.
No error shows, and I have test with reinstall this plugin and whole hero environment.
Could you give any suggestion?
百度站长官方给出的sitemap.xml文件示例中,时间字段的格式为YYYY-MM-DD,而该插件生成的格式为YYYY-MM-DDTHH:mm:SS.000Z
安装了 [email protected]
和 [email protected]
hexo clean && hexo g
后发现无法生成 baidusitemap.xml
调试时发现rename baidusitemap.xml -> sitemap.xml
,不知道是不是只有我个人出现这样的问题。
后来直接在主题配置文件里 只配置
baidusitemap:
path: baidusitemap.xml
才可以生成 baidusitemap.xml
,而且也生成了 sitemap.xml
,不知道为什么???
In readme, you say
if your hexo version is 2.x.x, you can configure this plugin in _config.yml.
baidusitemap:
path: baidusitemap.xml
if version is 3.x.x, you should configure this plugin in _config.yml.
baidusitemap:
path: baidusitemap.xml
So the only difference is that in 3.x.x we don't need the white spaces before 'path'?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.