1.0.1 • Published 1 year ago

vite-plugin-abbrlink v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

vite-plugin-abbrlink

Add the abbrlink attribute to the markdown file in the specified directory

According to hexo-abbrlink functional logic implementation

🏁 Installation

Install the package as a devDependencies

pnpm add vite-plugin-abbrlink -D

🚀 Usage

Add it to your plugins in vite.config.ts

import { defineConfig } from 'vite'
import vitePluginAbbrLink from 'vite-plugin-abbrlink'

export default defineConfig({
  plugins: [
    plugins: [vitePluginAbbrLink({
      paths:['src/content/**/*.md'],
      alg:'crc32'
    })]
  ],
})

🛠️ Options

paths

Type:string | string[]

Default:[]

To set up the md file in the directory you need, use regular expressions, such as src/content/*/.md

alg

Type:'crc32' | 'crc16'

Default: crc32

Algorithm (currently supports crc16 and crc32, default is crc16)

Sample

The generated link will look like the following:

crc16
https://tangerball.com/posts/66c8
crc32 & hex
https://tangerball.com/posts/8ddf18fb
1.0.1

1 year ago

1.0.0

1 year ago