Skip to content

Commit f9647e3

Browse files
authored
Back online
0 parents  commit f9647e3

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 高远
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# hexo-baidu-url-push
2+
3+
[![Travis branch](https://img.shields.io/travis/rust-lang/rust/master.svg)]()
4+
[![npm](https://img.shields.io/npm/l/express.svg)](https://github.com/xuanmiaog/hexo-baidu-url-push/blob/master/LICENSE)
5+
[![](https://img.shields.io/badge/npm-package-brightgreen.svg)](https://www.npmjs.com/package/hexo-baidu-url-push)
6+
[![](https://img.shields.io/badge/Hexo-2.4%2B-brightgreen.svg)](http://hexo.io)
7+
8+
## 简介
9+
![jspush](https://www.xuanmiao.info/2017/03/19/Hexo-Plugin-%E7%99%BE%E5%BA%A6%E9%93%BE%E6%8E%A5%E8%87%AA%E5%8A%A8%E6%8E%A8%E9%80%81%E5%B7%A5%E5%85%B7/jspush.JPG)
10+
11+
> 自动推送是百度站长平台为提高站点新增网页发现速度推出的工具,安装自动推送JS代码的网页,在页面被访问时,页面URL将立即被推送给百度。
12+
13+
一个hexo插件,使用百度JS链路自动推送方法,提交链接到百度
14+
15+
## 安装
16+
17+
### npm
18+
19+
```
20+
npm install hexo-baidu-url-push --save
21+
```
22+
## 配置
23+
```
24+
hexo --debug
25+
```
26+
可以看到插件已经开始工作
27+
28+
## 证书
29+
### MIT

index.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var fs = require('fs');
2+
hexo.extend.filter.register('before_post_render', function(data){
3+
var file_content = fs.readFileSync(path.join(_dirname,"push.js"),"utf-8");
4+
data.content += file_content;
5+
return data;
6+
});

package.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"_from": "hexo-baidu-url-push",
3+
"_id": "hexo-baidu-url-push@0.1.3",
4+
"_inBundle": false,
5+
"_integrity": "sha1-VQAMqCBVfYi6G6KXeXgrynXQ3mA=",
6+
"_location": "/hexo-baidu-url-push",
7+
"_phantomChildren": {},
8+
"_requested": {
9+
"type": "tag",
10+
"registry": true,
11+
"raw": "hexo-baidu-url-push",
12+
"name": "hexo-baidu-url-push",
13+
"escapedName": "hexo-baidu-url-push",
14+
"rawSpec": "",
15+
"saveSpec": null,
16+
"fetchSpec": "latest"
17+
},
18+
"_requiredBy": [
19+
"#USER",
20+
"/"
21+
],
22+
"_resolved": "https://registry.npmjs.org/hexo-baidu-url-push/-/hexo-baidu-url-push-0.1.3.tgz",
23+
"_shasum": "55000ca820557d88ba1ba29779782bca75d0de60",
24+
"_spec": "hexo-baidu-url-push",
25+
"_where": "C:\\Users\\gaoy3",
26+
"author": {
27+
"name": "XuanmiaoG"
28+
},
29+
"bugs": {
30+
"url": "https://github.com/XuanmiaoG/hexo-baidu-url-push/issues"
31+
},
32+
"bundleDependencies": false,
33+
"deprecated": false,
34+
"description": "A hexo plugin, using Baidu JS automatic link push method, submit links to Baidu",
35+
"homepage": "https://github.com/XuanmiaoG/hexo-baidu-url-push#readme",
36+
"keywords": [
37+
"hexo",
38+
"plugin",
39+
"baidu",
40+
"seo"
41+
],
42+
"license": "MIT",
43+
"main": "index.js",
44+
"name": "hexo-baidu-url-push",
45+
"repository": {
46+
"type": "git",
47+
"url": "git+https://github.com/XuanmiaoG/hexo-baidu-url-push.git"
48+
},
49+
"scripts": {
50+
"test": "echo \"Error: no test specified\" && exit 1"
51+
},
52+
"version": "0.1.3"
53+
}

push.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
(function(){
3+
var bp = document.createElement('script');
4+
var curProtocol = window.location.protocol.split(':')[0];
5+
if (curProtocol === 'https') {
6+
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
7+
}
8+
else {
9+
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
10+
}
11+
var s = document.getElementsByTagName("script")[0];
12+
s.parentNode.insertBefore(bp, s);
13+
})();
14+
</script>

0 commit comments

Comments
 (0)