@ampless/plugin-seo 0.2.0-alpha.5 → 0.2.0-alpha.50
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.ja.md +58 -0
- package/README.md +3 -0
- package/dist/index.js +2 -0
- package/package.json +19 -3
package/README.ja.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
> English: [README.md](./README.md)
|
|
2
|
+
>
|
|
3
|
+
|
|
4
|
+
# @ampless/plugin-seo
|
|
5
|
+
|
|
6
|
+
[ampless](https://github.com/heavymoons/ampless) 向け SEO プラグイン。投稿ごと・サイトごとのメタデータ(Open Graph、Twitter カード、canonical)を生成し、投稿セットが変更されるたびに `sitemap.xml` を S3 に再生成します。
|
|
7
|
+
|
|
8
|
+
> **プレリリース / アルファ版。** v1.0 まではマイナーバージョンでも破壊的変更が入る可能性があります。
|
|
9
|
+
|
|
10
|
+
## インストール
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @ampless/plugin-seo@alpha
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 設定
|
|
17
|
+
|
|
18
|
+
`cms.config.ts` に記述します:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { defineConfig } from 'ampless'
|
|
22
|
+
import seoPlugin from '@ampless/plugin-seo'
|
|
23
|
+
|
|
24
|
+
export default defineConfig({
|
|
25
|
+
// ...
|
|
26
|
+
plugins: [
|
|
27
|
+
seoPlugin({
|
|
28
|
+
// defaultOgImage: 'https://example.com/og-default.png',
|
|
29
|
+
// twitterSite: '@example',
|
|
30
|
+
// twitterCreator: '@author',
|
|
31
|
+
// twitterCard: 'summary_large_image',
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| オプション | デフォルト | 備考 |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `defaultOgImage` | なし | 設定時、全投稿の `og:image` と `twitter:image` のフォールバックとして使用 |
|
|
40
|
+
| `twitterSite` | なし | サイトの `@handle` |
|
|
41
|
+
| `twitterCreator` | なし | 投稿著者の `@handle` |
|
|
42
|
+
| `twitterCard` | `'summary_large_image'` | カードスタイル |
|
|
43
|
+
| `siteUrl` | `site.url` | ベース URL のオーバーライド(ステージング環境など) |
|
|
44
|
+
| `priority` / `changefreq` / `limit` | (サイトマップのデフォルト) | サイトマップエントリーの調整 |
|
|
45
|
+
|
|
46
|
+
## 生成されるもの
|
|
47
|
+
|
|
48
|
+
- **投稿ごとのメタデータ**(Next.js `generateMetadata` 形式): `title`、`description`、`alternates.canonical`、`openGraph`(article タイプ、url、images)、`twitter`(カード、ハンドル、images)
|
|
49
|
+
- **サイトレベルのメタデータ**: ルートレイアウト用のデフォルト — title、description、og:website
|
|
50
|
+
- **`/sitemap.xml`** — 全 URL セット。`content.published` / `content.unpublished` / `content.deleted` / `content.updated` イベントごとに `s3://<bucket>/public/plugins/seo/sitemap.xml` に再生成されます。テンプレートの `/sitemap.xml` ルートハンドラーが配信します。
|
|
51
|
+
|
|
52
|
+
## トラストレベル
|
|
53
|
+
|
|
54
|
+
`trusted` — サイトマップの再生成は、投稿テーブルへの読み取りアクセスと、サイトの S3 バケット内 `public/plugins/seo/` への書き込みアクセスを持つ、trusted Lambda プロセッサーで実行されます。メタデータヘルパー(`metadata` / `siteMetadata`)は Next.js の SSR 中に動作する純粋関数であり、AWS へのアクセスは不要です。
|
|
55
|
+
|
|
56
|
+
## ライセンス
|
|
57
|
+
|
|
58
|
+
[MIT](../../LICENSE)
|
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
|
|
1
4
|
# @ampless/plugin-seo
|
|
2
5
|
|
|
3
6
|
SEO plugin for [ampless](https://github.com/heavymoons/ampless). Generates per-post and per-site metadata (Open Graph, Twitter card, canonical) and keeps a `sitemap.xml` regenerated to S3 whenever the post set changes.
|
package/dist/index.js
CHANGED
|
@@ -93,8 +93,10 @@ function seoPlugin(options = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
return definePlugin({
|
|
95
95
|
name: "seo",
|
|
96
|
+
packageName: "@ampless/plugin-seo",
|
|
96
97
|
apiVersion: 1,
|
|
97
98
|
trust_level: "trusted",
|
|
99
|
+
capabilities: ["eventHooks", "writePublicAsset", "metadata"],
|
|
98
100
|
hooks: {
|
|
99
101
|
"content.published": rebuild,
|
|
100
102
|
"content.unpublished": rebuild,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/plugin-seo",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.50",
|
|
4
4
|
"description": "SEO plugin for ampless",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts"
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
12
13
|
},
|
|
13
14
|
"files": [
|
|
14
15
|
"dist",
|
|
@@ -25,13 +26,28 @@
|
|
|
25
26
|
"homepage": "https://github.com/heavymoons/ampless/tree/main/packages/plugin-seo#readme",
|
|
26
27
|
"bugs": "https://github.com/heavymoons/ampless/issues",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"ampless": "0.
|
|
29
|
+
"ampless": "1.0.0-alpha.50"
|
|
29
30
|
},
|
|
30
31
|
"keywords": [
|
|
31
32
|
"ampless",
|
|
32
33
|
"plugin",
|
|
34
|
+
"ampless-plugin",
|
|
33
35
|
"seo"
|
|
34
36
|
],
|
|
37
|
+
"amplessPlugin": {
|
|
38
|
+
"apiVersion": 1,
|
|
39
|
+
"name": "seo",
|
|
40
|
+
"trustLevel": "trusted",
|
|
41
|
+
"capabilities": [
|
|
42
|
+
"eventHooks",
|
|
43
|
+
"writePublicAsset",
|
|
44
|
+
"metadata"
|
|
45
|
+
],
|
|
46
|
+
"displayName": {
|
|
47
|
+
"en": "SEO",
|
|
48
|
+
"ja": "SEO"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
35
51
|
"scripts": {
|
|
36
52
|
"build": "tsup",
|
|
37
53
|
"dev": "tsup --watch",
|