Giter Club home page Giter Club logo

vuepress-plugin-add-copyright's Introduction

vuepress-plugin-add-copyright

GitHub license npm npm

功能

当用户复制你的 VuePress 站点内容时,该插件会自动添加你定义好的版权信息。

效果

效果图

这只是默认的效果,版权信息完全可以根据个人的喜好来定制化。

安装

npm install -D @xzhi/vuepress-plugin-add-copyright

使用插件

// .vuepress/config.js
module.exports = {
  plugins: [
    [
      '@xzhi/add-copyright',
      {
        // 作者名称
        authorName: 'Xzhi',
        // 触发版权信息或 noCopy 效果的最小的复制文本长度
        minLength: 100,
      }
    ],
  ]
}

使用 frontmatter

该插件是默认全局开启的,你可以在特定页面的 frontmatter 中进行启用或者禁用这个插件:

---
copyright: false # 在特定页面禁用这个插件
---

配置项

  • authorName

    • 类型: string
    • 默认值: Xzhi

    作者名称。

  • disabled

    • 类型: boolean
    • 默认值: false

    是否禁用该插件的功能。

  • copyrightLoca

    • 类型: string
    • 默认值: after

    版权信息的位置,可选项[before | after]。before:版权信息放在复制文本的前面。after:与before相反。

  • noCopy

    • 类型: boolean
    • 默认值: false

    是否禁止复制。

  • minLength

    • 类型: number
    • 默认值: 100

    触发版权信息或 noCopy 效果的最小的复制文本长度。

  • statement

    • 类型: string
    • 默认值: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

    版权声明内容。

  • authorNameTag

    • 类型: string
    • 默认值: 作者:

    作者名称标签。

  • webLinkTag

    • 类型: string
    • 默认值: 原文:

    网页链接标签。

  • boundary

    • 类型: string
    • 默认值: \n

    复制文本与版权信息的边界线符号。

  • allCustom

    • 类型: string
    • 默认值: ''

    完全自定义版权信息内容(权限比较大),#{webLink}是网页链接的占位符。

    例子:

    // .vuepress/config.js
    module.exports = {
      plugins: [
        [
          '@xzhi/add-copyright',
          {
            allCustom: '转载请注明本文出自Xzhi的博客(#{webLink})'
          }
        ],
      ]
    }

    效果:

    效果图

vuepress-plugin-add-copyright's People

Contributors

github-xzhi avatar

Stargazers

 avatar

Watchers

 avatar

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.