Code Monkey home page Code Monkey logo

vuepress-plugin-sponsor's Introduction

介绍

这是一个vuepress的打赏插件,借鉴于开源项目Kaiyuan/sponsor-page。由于开源项目是基于jQuery来实现动画效果和DOM操作的,为了减轻插件依赖,在原开源项目的基础上简单重构了一下,将jQuery替换成Vue。

使用

在配置文件(.vuepress/config.js)添加如下代码,选择Babel 式或对象式,例子如下。

Babel 式

module.exports = {
  plugins: [
     [
      'vuepress-plugin-sponsor',
      {
        theme: 'simple',
        alipay: '/sponsor-qrcode/qrcode-alipay.png',
        wechat: '/sponsor-qrcode/qrcode-wechat.png',
        qq: '/sponsor-qrcode/qrcode-qq.png',
        paypal: 'https://www.paypal.me/yokefellow',
        duration: 2000
      }
    ]
  ]
}

对象式

module.exports = {
  plugins: {
    'vuepress-plugin-sponsor': {
      theme: 'simple',
      alipay: '/sponsor-qrcode/qrcode-alipay.png',
      wechat: '/sponsor-qrcode/qrcode-wechat.png',
      qq: '/sponsor-qrcode/qrcode-qq.png',
      paypal: 'https://www.paypal.me/yokefellow',
      duration: 2000
    }
  }
}

配置选项

Name Type Default Description
theme String simple 插件主题(simple / drinks)
alipay String null 支付宝收款码的图片路径
wechat String null 微信收款码的图片路径
qq String null QQ收款码的图片路径
paypal String null PayPal 收款地址
duration Number 1500 当收款选项为null时,点击选项后弹出的消息显示时间(ms)
  • 小小的建议:添加支付宝/微信/QQ等收款码时,建议裁剪为正方形并放在public目录下

Front Matter

在需要显示打赏插件的页面(.md)中设置变量

---
showSponsor: true
---

vuepress-plugin-sponsor's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.