npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hexo-qiniu-uploader

v1.0.5

Published

A Hexo plugin for uploading assets to CDN

Downloads

4

Readme

hexo-qiniu-uploader

A Hexo plugin for uploading assets to CDN

Latest Stable Version NPM Downloads GitHub stars

简介

这是一个可以帮你把所有图片上传到cdn的hexo插件。

此插件不需要关注图片、js、css以什么的方式引用,正确引用的图片、js、css都会可被上传到cdn中。原理是替换所有生成的资源引用,并把引用的资源上传到七牛云

项目作者:Sushome
代码贡献:

安装

在你的hexo主目录下运行以下命令进行安装:

npm install hexo-qiniu-uploader --save

添加插件配置信息到 _config.yml 文件中,此插件需要配置三个字段的信息,分别是deplo、cdn、qiniu:


deploy:
  type: 'upload'  
cdn:
  enable: true
  onlypost: false
  url: https://static.xxx.cn
  webImage: true
qiniu:
  bucket: 'bundle'
  dirPrefix: 'static'
  secret_file: qn-sec.json
  allow_file: 'assets-css-images-js'
  update_exist: true

这里对配置中的几个需要注意的参数进行说明:

  • deploy 字段:
deploy:
##type: 'upload' 此参数固定
  • cdn 字段:

enable为是否启用
onlypost: false仅替换文章中的图片
url: https://static.xxx.cn
img_url: https://static.xxx.cn
webImage: 是否在替换的图片后添加-web参数

  • qiniu 字段:

env 参数: 如果使用env字段,那么access_key和secret_key将作为process.env的key并引用 access_key 参数: 上传密钥AccessKey
secret_key 参数: 上传密钥SecretKey
secret_file 参数: 秘钥文件路径,可以将上述两个属性配置到文件内,防止泄露,json格式。绝对路径相对路径均可
allow_file 参数: public中允许上传的文件夹(如果hexo build后生成出其他路径的资源文件则需要加上去),使用方法用-分隔开
update_exist 参数: 是否覆盖上传

使用方法:

    hexo clean
    hexo generate
    hexo deploy