@riebeckite/plugin-discord-embed 0.0.20 → 0.0.22
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 +6 -12
- package/README_ja.md +6 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @riebeckite/plugin-discord-embed
|
|
2
2
|
|
|
3
|
+
<!-- Generated from docs/docs/plugins/discord-embed.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
|
|
4
|
+
|
|
3
5
|
Completes each page's `<head>` for Discord link previews.
|
|
4
6
|
|
|
5
7
|
Discord's `Discordbot` reads the shared page's `<head>` metadata to build its
|
|
@@ -50,14 +52,7 @@ default.
|
|
|
50
52
|
|
|
51
53
|
## Emitted tags
|
|
52
54
|
|
|
53
|
-
The `onManifestCreated` hook assigns `entry.headTags` for every entry
|
|
54
|
-
|
|
55
|
-
```html
|
|
56
|
-
<meta name="theme-color" content="#1ABC9C" />
|
|
57
|
-
<meta property="og:image:alt" content="Article title" />
|
|
58
|
-
<meta property="og:image:width" content="1200" />
|
|
59
|
-
<meta property="og:image:height" content="630" />
|
|
60
|
-
```
|
|
55
|
+
The `onManifestCreated` hook assigns `entry.headTags` for every entry. The site shell renders those tags in the document head, so they are available to Discord and other crawlers rather than appearing in article content.
|
|
61
56
|
|
|
62
57
|
## The site shell renders `headTags`
|
|
63
58
|
|
|
@@ -65,7 +60,7 @@ This plugin does not own the `<head>`. It provides
|
|
|
65
60
|
`ContentManifestEntry.headTags`; whether to render them is the site's decision.
|
|
66
61
|
A site route sets `c.set("headTags", entry.headTags ?? [])`, and
|
|
67
62
|
`app/routes/_renderer.tsx` maps them to `<meta>` / `<link>` / `<script>`.
|
|
68
|
-
See [HonoX Integration](
|
|
63
|
+
See [HonoX Integration](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/framework/honox-integration.md), section
|
|
69
64
|
"Site application contract", for details.
|
|
70
65
|
|
|
71
66
|
## Exports
|
|
@@ -78,6 +73,5 @@ See [HonoX Integration](../../../docs/docs/framework/honox-integration.md), sect
|
|
|
78
73
|
|
|
79
74
|
## See also
|
|
80
75
|
|
|
81
|
-
- [HonoX Integration](
|
|
82
|
-
- [Plugin system](
|
|
83
|
-
|
|
76
|
+
- [HonoX Integration](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/framework/honox-integration.md)
|
|
77
|
+
- [Plugin system](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.md)
|
package/README_ja.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @riebeckite/plugin-discord-embed
|
|
2
2
|
|
|
3
|
+
<!-- Generated from docs/docs/plugins/discord-embed.ja.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
|
|
4
|
+
|
|
3
5
|
Discord のリンクプレビュー向けに、各ページの `<head>` を補完するプラグインです。
|
|
4
6
|
|
|
5
7
|
Discord の `Discordbot` は共有されたページの `<head>` メタデータを読んでプレビューカードを組み立てます。
|
|
@@ -46,20 +48,13 @@ frontmatter の色が無効な場合は診断 `discord-embed-invalid-color`(wa
|
|
|
46
48
|
|
|
47
49
|
## 出力するタグ
|
|
48
50
|
|
|
49
|
-
`onManifestCreated` フックで、すべてのエントリーに `entry.headTags` を設定します。
|
|
50
|
-
|
|
51
|
-
```html
|
|
52
|
-
<meta name="theme-color" content="#1ABC9C" />
|
|
53
|
-
<meta property="og:image:alt" content="記事タイトル" />
|
|
54
|
-
<meta property="og:image:width" content="1200" />
|
|
55
|
-
<meta property="og:image:height" content="630" />
|
|
56
|
-
```
|
|
51
|
+
`onManifestCreated` フックで、すべてのエントリーに `entry.headTags` を設定します。Site shell はこれらを文書の head に描画するため、記事本文には表示せず Discord などのクローラーが利用します。
|
|
57
52
|
|
|
58
53
|
## Site shell が headTags を描画する
|
|
59
54
|
|
|
60
55
|
このプラグインは `<head>` を所有しません。プラグインが提供するのは `ContentManifestEntry.headTags` であり、描画するかどうかは Site が決めます。
|
|
61
56
|
Site の route が `c.set("headTags", entry.headTags ?? [])` を設定し、`app/routes/_renderer.tsx` がそれを `<meta>` / `<link>` / `<script>` に変換します。
|
|
62
|
-
詳しくは [HonoX Integration](
|
|
57
|
+
詳しくは [HonoX Integration](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/framework/honox-integration.ja.md) の "Site Application の拡張 contract" を参照してください。
|
|
63
58
|
|
|
64
59
|
## 主なエクスポート
|
|
65
60
|
|
|
@@ -70,6 +65,5 @@ Site の route が `c.set("headTags", entry.headTags ?? [])` を設定し、`app
|
|
|
70
65
|
|
|
71
66
|
## 関連資料
|
|
72
67
|
|
|
73
|
-
- [HonoX Integration](
|
|
74
|
-
- [プラグインシステム](
|
|
75
|
-
|
|
68
|
+
- [HonoX Integration](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/framework/honox-integration.ja.md)
|
|
69
|
+
- [プラグインシステム](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.ja.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-discord-embed",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@riebeckite/core": "0.0.
|
|
17
|
+
"@riebeckite/core": "0.0.22"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|