vitepress-linkcard 1.2.3 → 1.2.5

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/README.md ADDED
@@ -0,0 +1,111 @@
1
+ <h1 align="center">
2
+ vitepress-linkcard
3
+ </h1>
4
+
5
+ <div align="center">
6
+
7
+ **A Vitepress plugin to generate a pretty linkcard with OGP.**
8
+
9
+ Slightly more readable README created with this plugin is [here](https://asumoranda.com/posts/10-vitepress-linkcard.html).
10
+
11
+ [![NPM Version](https://img.shields.io/npm/v/vitepress-linkcard?style=flat&logo=npm&logoColor=white&label=npmjs&color=%23CB3837)](https://www.npmjs.com/package/vitepress-linkcard)
12
+ [![NPM bundle size](https://img.shields.io/bundlephobia/min/vitepress-linkcard)](https://www.npmjs.com/package/vitepress-linkcard)
13
+ [![NPM License](https://img.shields.io/npm/l/vitepress-linkcard)](/LICENSE)
14
+
15
+ [![VitePress](https://img.shields.io/badge/For_VitePress-v1.6.4-%235C73E7?logo=vitepress&logoColor=white)](https://vuejs.github.io/vitepress/v1/)
16
+ [![Yarn](https://img.shields.io/badge/Built_with_Yarn-v4.9.2-%232C8EBB?logo=yarn&logoColor=white)](https://yarnpkg.com/)
17
+ [![ESLint](https://img.shields.io/badge/Lint_with-ESLint-%234B32C3?style=flat&logo=eslint&logoColor=white&labelColor=gray)](https://github.com/asumo-1xts/vitepress-linkcard/actions/workflows/eslint.yml)
18
+ [![Prettier](https://img.shields.io/badge/Format_with-Prettier-%23F7B93E?style=flat&logo=prettier&logoColor=white&labelColor=gray)](https://github.com/asumo-1xts/vitepress-linkcard/actions/workflows/prettier.yml)
19
+
20
+ <img src="https://github.com/asumo-1xts/vitepress-linkcard/blob/main/docs/screen.webp?raw=true" width=90% alt="How it shows" />
21
+
22
+ This plugin was forked from [markdown-it-link-to-card](https://github.com/luckrya/markdown-it-link-to-card).
23
+
24
+ </div>
25
+
26
+ ## Getting started
27
+
28
+ ### Install
29
+
30
+ ```shell
31
+ npm i -D vitepress-linkcard # npm
32
+ yarn add -D vitepress-linkcard # yarn
33
+ pnpm add -D vitepress-linkcard # pnpm
34
+ ```
35
+
36
+ ### Usage
37
+
38
+ #### `docs/.vitepress/config.ts`
39
+
40
+ ```ts
41
+ import { defineConfig } from "vitepress";
42
+ import { linkToCardPlugin } from "vitepress-linkcard";
43
+ import type { LinkToCardPluginOptions } from "vitepress-linkcard";
44
+
45
+ export default defineConfig({
46
+ // ...
47
+ markdown: {
48
+ config: (md) => {
49
+ md.use<LinkToCardPluginOptions>(linkToCardPlugin, {
50
+ // // Supported options:
51
+ // target: "_self",
52
+ // borderColor: "#039393",
53
+ // bgColor: "#CB3837"
54
+ });
55
+ },
56
+ }
57
+ // ...
58
+ });
59
+ ```
60
+
61
+ #### `*.md`
62
+
63
+ Generates a linkcard when `@:` appended.
64
+
65
+ ```md
66
+ [example](@:https://example.com)
67
+ ```
68
+
69
+ ## Supported options
70
+
71
+ ### borderColor
72
+
73
+ Specifies the border color of linkcards with a color code. For exmaple:
74
+
75
+ - `#7d7d7dff` (default)
76
+ - `rgba(3, 147, 147, 0.39)`
77
+ - ...
78
+
79
+ ### bgColor
80
+
81
+ Specifies the background color of linkcards with a color code. For exmaple:
82
+
83
+ - `#7d7d7d00` (default)
84
+ - `rgba(3, 147, 147, 0.39)`
85
+ - ...
86
+
87
+ ### target
88
+
89
+ Specifies the target window in which to open a link.
90
+
91
+ - `_blank` (default)
92
+ - `_self`
93
+ - `_top`
94
+ - `_parent`
95
+
96
+ ## Other specifications
97
+
98
+ ### `.linkcard_cache.json`
99
+
100
+ It is generated automatically in root dir and cache all the parsed metadata.
101
+
102
+ You can move it to `.config` directory or edit it if needed.
103
+
104
+ ### Special handling for `github.com`
105
+
106
+ When the domain is `github.com`, trimming is performed as shown in the following example to avoid duplication of the title and description.
107
+
108
+ | | Title | Description |
109
+ | - | - | - |
110
+ | 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. |
111
+ | After | asumo-1xts/vitepress-linkcard | A VitePress plugin to generate a pretty linkcard. |
package/dist/.cjs.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vitepress-linkcard v1.2.3
2
+ * vitepress-linkcard v1.2.5
3
3
  * (c) 2022 - 2025 luckrya
4
4
  * Released under the MIT License.
5
5
  */
package/dist/.esm.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vitepress-linkcard v1.2.3
2
+ * vitepress-linkcard v1.2.5
3
3
  * (c) 2022 - 2025 luckrya
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -40,8 +40,7 @@
40
40
  },
41
41
  "files": [
42
42
  "dist",
43
- "types",
44
- ".github/README.md"
43
+ "types"
45
44
  ],
46
45
  "keywords": [
47
46
  "thumbnail",
@@ -61,7 +60,6 @@
61
60
  "publishConfig": {
62
61
  "registry": "https://registry.npmjs.org/"
63
62
  },
64
- "readme": "./.github/README.md",
65
63
  "repository": {
66
64
  "type": "git",
67
65
  "url": "git+https://github.com/asumo-1xts/vitepress-linkcard.git"
@@ -77,5 +75,5 @@
77
75
  },
78
76
  "type": "module",
79
77
  "types": "./types/index.d.ts",
80
- "version": "1.2.3"
78
+ "version": "1.2.5"
81
79
  }