Skip to content

xuexb/hexo-mip-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-mip-push

自动抓取 public_dir 目录下的文件推送到百度站长平台

使用

安装

npm install --save hexo-mip-push

配置

# _config.yml
url: https://www.example.com
deploy:
  - type: 'mip'
    token: 'token'
    site: 'www.example.com'
    pattern: '**/*.html'
    defaultIndex: ''
    ignore:
        - '/ignore.html'
        - '/^/404/'
变量名 说明 默认值
token 百度站长平台 MIP 数据提交的 token -
site 百度站长平台 MIP 站点的 site -
pattern 搜索文件规则, glob模式, 以 public_dir 为基础路径 **/*.html
defaultIndex 默认主页, 如果配置相同的目录主页将被删除 -
ignore 忽略不提交的文件, 如果以 / 开头和结束, 将使用正则判断 -

ignore

- /ignore.html
- /^/404/
- /error/

将忽略:

  1. 完全匹配的 /ignore.html 路径
  2. 正则匹配 ^\/404 成功的路径
  3. 正则匹配 error 成功的路径

内部使用的 new RegExp() 生成的正则判定

defaultIndex: index.html

抓取到的文件如:

[
    "/archives/index.html",
    "/index.html",
    "/post/about.html"
]

生成的提交链接如:

[
    "https://www.example.com/archives/",
    "https://www.example.com/",
    "https://www.example.com/post/about.html"
]

注意, 如果 ignoredefaultIndex 同时配置, 将先使用 ignore 处理忽略文件, 再使用 defaultIndex 处理默认首页

License

MIT

About

为 Hexo MIP 主题自动推送到站长平台

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published