vitepress-linkcard 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 No bug
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
vitepress-linkcard
|
|
3
|
+
</h1>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/vitepress-linkcard)
|
|
8
|
+

|
|
9
|
+
[
|
|
10
|
+
](/LICENSE)
|
|
11
|
+
|
|
12
|
+
[](https://vuejs.github.io/vitepress/v1/)
|
|
13
|
+
[](https://yarnpkg.com/)
|
|
14
|
+
[](https://github.com/asumo-1xts/vitepress-linkcard/actions/workflows/eslint.yml)
|
|
15
|
+
[](https://github.com/asumo-1xts/vitepress-linkcard/actions/workflows/prettier.yml)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://github.com/asumo-1xts/vitepress-linkcard/blob/main/image/screen.webp?raw=true">
|
|
21
|
+
<img width="85%" src="https://github.com/asumo-1xts/vitepress-linkcard/blob/main/.config/screen.webp?raw=true" />
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<div align="center">
|
|
26
|
+
|
|
27
|
+
**This plugin was forked from [markdown-it-link-to-card](https://github.com/luckrya/markdown-it-link-to-card).**
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
## Getting started
|
|
32
|
+
|
|
33
|
+
### Install
|
|
34
|
+
|
|
35
|
+
```shell
|
|
36
|
+
npm i -D vitepress-linkcard # npm
|
|
37
|
+
yarn add -D vitepress-linkcard # yarn
|
|
38
|
+
pnpm add -D vitepress-linkcard # pnpm
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Usage
|
|
42
|
+
|
|
43
|
+
#### `docs/.vitepress/config.ts`
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { defineConfig } from "vitepress";
|
|
47
|
+
import { linkToCardPlugin } from "vitepress-linkcard";
|
|
48
|
+
import type { LinkToCardPluginOptions } from "vitepress-linkcard";
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
// ...
|
|
52
|
+
markdown: {
|
|
53
|
+
config: (md) => {
|
|
54
|
+
md.use<LinkToCardPluginOptions>(linkToCardPlugin, {
|
|
55
|
+
// // Supported options:
|
|
56
|
+
// target: "_self",
|
|
57
|
+
// borderColor: "#039393",
|
|
58
|
+
// bgColor: "#CB3837"
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
// ...
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### `*.md`
|
|
67
|
+
|
|
68
|
+
Generates a link card when `@:` appended.
|
|
69
|
+
|
|
70
|
+
```md
|
|
71
|
+
[example](@:https://example.com)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Supported options
|
|
75
|
+
|
|
76
|
+
### borderColor
|
|
77
|
+
|
|
78
|
+
Specifies the border color of linkcards with a color code. For exmaple:
|
|
79
|
+
|
|
80
|
+
- `#7d7d7dff` (default)
|
|
81
|
+
- `rgba(3, 147, 147, 0.39)`
|
|
82
|
+
- ...
|
|
83
|
+
|
|
84
|
+
### bgColor
|
|
85
|
+
|
|
86
|
+
Specifies the background color of linkcards with a color code. For exmaple:
|
|
87
|
+
|
|
88
|
+
- `#7d7d7d00` (default)
|
|
89
|
+
- `rgba(3, 147, 147, 0.39)`
|
|
90
|
+
- ...
|
|
91
|
+
|
|
92
|
+
### target
|
|
93
|
+
|
|
94
|
+
Specifies the target window in which to open a link.
|
|
95
|
+
|
|
96
|
+
- `_blank` (default)
|
|
97
|
+
- `_self`
|
|
98
|
+
- `_top`
|
|
99
|
+
- `_parent`
|
|
100
|
+
|
|
101
|
+
## Other specifications
|
|
102
|
+
|
|
103
|
+
### Special handling for `github.com`
|
|
104
|
+
|
|
105
|
+
When the domain is `github.com`, trimming is performed as shown in the following example to avoid duplication of the title and description.
|
|
106
|
+
| | Title | Description |
|
|
107
|
+
| - | - | - |
|
|
108
|
+
| Before | GitHub - asumo-1xts/vitepress-linkcard: A VitePress plugin to generate a pretty linkcard. | A VitePress plugin to generate a pretty linkcard. Contribute to asumo-1xts/vitepress-linkcard development by creating an account on GitHub. |
|
|
109
|
+
| After | asumo-1xts/vitepress-linkcard | A VitePress plugin to generate a pretty linkcard. |
|
|
110
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "aSumo",
|
|
3
|
+
"babel": {
|
|
4
|
+
"presets": [
|
|
5
|
+
"@babel/env",
|
|
6
|
+
"@babel/typescript"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/asumo-1xts/vitepress-linkcard"
|
|
11
|
+
},
|
|
12
|
+
"description": "A vitepress-plugin to generate a pretty linkcard with OGP.",
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@babel/core": "^7.28.5",
|
|
15
|
+
"@babel/preset-env": "^7.28.5",
|
|
16
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
17
|
+
"@eslint/js": "^9.39.1",
|
|
18
|
+
"@luckrya/utility": "^0.1.1",
|
|
19
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
20
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
21
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
22
|
+
"@types/babel__core": "^7",
|
|
23
|
+
"@types/markdown-it": "^13.0.2",
|
|
24
|
+
"@types/node": "^24.10.0",
|
|
25
|
+
"eslint": "^9.39.1",
|
|
26
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
27
|
+
"globals": "^16.5.0",
|
|
28
|
+
"jiti": "^2.6.1",
|
|
29
|
+
"markdown-it": "^13.0.2",
|
|
30
|
+
"npm-check-updates": "^19.1.2",
|
|
31
|
+
"prettier": "^3.6.2",
|
|
32
|
+
"rollup": "^2.79.2",
|
|
33
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
34
|
+
"typedoc": "^0.28.14",
|
|
35
|
+
"typedoc-theme-hierarchy": "^6.0.0",
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"typescript-eslint": "^8.46.3",
|
|
38
|
+
"vue-eslint-parser": "^10.2.0",
|
|
39
|
+
"xmlhttprequest": "^1.8.0"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"types"
|
|
44
|
+
],
|
|
45
|
+
"keywords": [
|
|
46
|
+
"thumbnail",
|
|
47
|
+
"typescript",
|
|
48
|
+
"markdown-it",
|
|
49
|
+
"metadata",
|
|
50
|
+
"ogp",
|
|
51
|
+
"linkcard",
|
|
52
|
+
"vite",
|
|
53
|
+
"vitepress"
|
|
54
|
+
],
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"main": "./dist/.esm.min.js",
|
|
57
|
+
"module": "./dist/.esm.min.js",
|
|
58
|
+
"name": "vitepress-linkcard",
|
|
59
|
+
"packageManager": "yarn@4.9.2",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"registry": "https://registry.npmjs.org/"
|
|
62
|
+
},
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "git+https://github.com/asumo-1xts/vitepress-linkcard.git"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc && rollup -c",
|
|
69
|
+
"clean": "rm -rf dist types",
|
|
70
|
+
"dev": "rollup -c -w",
|
|
71
|
+
"docs": "yarn typedoc",
|
|
72
|
+
"format": "yarn prettier --write src/**/* && rm -rf node_modules",
|
|
73
|
+
"lint": "yarn eslint --config .vscode/eslint.config.ts src/**/*",
|
|
74
|
+
"type:dts": "tsc --emitDeclarationOnly"
|
|
75
|
+
},
|
|
76
|
+
"type": "module",
|
|
77
|
+
"types": "./types/index.d.ts",
|
|
78
|
+
"version": "0.9.9"
|
|
79
|
+
}
|