Skip to content

Commit

Permalink
支持以环境变量保存 baidu, bing Token
Browse files Browse the repository at this point in the history
  • Loading branch information
cjh0613 committed Aug 7, 2020
1 parent cd0f9c5 commit 41dcdb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/baidu_submitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = function(args) {
var urlsPath = config.hexo_submit_urls_to_search_engine.txt_path;
var host = config.hexo_submit_urls_to_search_engine.baidu_host;
var token = config.hexo_submit_urls_to_search_engine.baidu_token;
if(token==0){
token = process.env.BAIDU_TOKEN;
}

var publicDir = this.public_dir;
var UrlsFile = pathFn.join(publicDir, urlsPath);
Expand Down
4 changes: 3 additions & 1 deletion lib/bing_submitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ module.exports = function(args) {
var urlsPath = config.hexo_submit_urls_to_search_engine.txt_path;
var host = config.hexo_submit_urls_to_search_engine.bing_host;
var token = config.hexo_submit_urls_to_search_engine.bing_token;

if(token==0){
token = process.env.BING_TOKEN;
}
var publicDir = this.public_dir;
var UrlsFile = pathFn.join(publicDir, urlsPath);
cjhreadline.readFileToArr(UrlsFile, function (data) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-submit-urls-to-search-engine",
"version": "1.0.1",
"version": "1.1.1",
"description": "Submit new posts urls to Google,Bing,Baidu search engine to improve the quality and speed of website collection",
"main": "index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
],
"author": {
"name": "CJH-Bruce",
"url": "https://cjh0613.github.io/en"
"url": "https://en.cjh0613.com/"
},
"license": "GPL-3.0-only",
"dependencies": {
Expand Down

0 comments on commit 41dcdb8

Please sign in to comment.