@riebeckite/plugin-series 0.0.14 → 0.0.15

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 CHANGED
@@ -141,4 +141,5 @@ matched with `.rb-series__item a[aria-current="page"]`.
141
141
 
142
142
  ## See also
143
143
 
144
- - [Plugin guide](../../../docs/en/reference/plugin-api.md)
144
+ - [Plugin guide](../../../docs/en/docs/reference/plugin-api.md)
145
+
package/README_ja.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## 概要
8
8
 
9
- `series()` は frontmatter からシリーズ情報を読み取り、該当するノートをグループ化して並べ替えたうえで、各ノートの HTML に `<nav class="rb-series">` ブロックを追加します。リンクには Core が解決したパーマリンクを使うため、`permalink` プラグインなどとも併用できます。1件だけのシリーズにはナビゲーションを出力しません。
9
+ `series()` は frontmatter からシリーズ情報を読み取り、該当するノートをグループ化して並べ替えたうえで、各ノートの HTML に `<nav class="rb-series">` ブロックを追加します。リンクには Core が解決したパーマリンクを使うため、`permalink` プラグインなどとも併用できます。1 件だけのシリーズにはナビゲーションを出力しません。
10
10
 
11
11
  このプラグインはビルド時のみ動作し、クライアント用のランタイムは持ちません(スタイルシートのみを登録します)。
12
12
 
@@ -53,7 +53,7 @@ series_order: 2
53
53
 
54
54
  ## 出力
55
55
 
56
- 2件以上あるシリーズの各ノートには、次のブロックが HTML の末尾に追加されます。
56
+ 2 件以上あるシリーズの各ノートには、次のブロックが HTML の末尾に追加されます。
57
57
 
58
58
  ```html
59
59
  <nav class="rb-series" data-series="何かを作る"
@@ -82,9 +82,9 @@ series_order: 2
82
82
  ## 公開 API
83
83
 
84
84
  - `series(options?)` / `seriesPlugin(options?)` — プラグインファクトリ
85
- - `buildSeriesIndex(manifest, name, options?)` — 1つのシリーズの並び順付きメンバー(`SeriesIndex | null`)。ランディングページ向け
85
+ - `buildSeriesIndex(manifest, name, options?)` — 1 つのシリーズの並び順付きメンバー(`SeriesIndex | null`)。ランディングページ向け
86
86
  - `renderSeriesIndex(manifest, name, options?)` — シリーズ全体の `<section>` ブロック
87
- - `renderSeriesNavigation(index, currentSlug, options?)` — ナビゲーション1つ分
87
+ - `renderSeriesNavigation(index, currentSlug, options?)` — ナビゲーション 1 つ分
88
88
  - `collectSeriesIndexes(manifest, options?)` — 全シリーズを出現順で取得
89
89
  - `resolveSeriesOptions(options?)` — 既定値を適用したオプション
90
90
  - 型: `SeriesOptions`, `ResolvedSeriesOptions`, `SeriesMember`, `SeriesIndex`
@@ -115,11 +115,12 @@ const html = renderSeriesIndex(manifest, "何かを作る");
115
115
 
116
116
  ## 制限
117
117
 
118
- - 1つのノートが所属できるシリーズは1つだけです。
119
- - 1件だけのシリーズにはナビゲーションを出力しません。
118
+ - 1 つのノートが所属できるシリーズは 1 つだけです。
119
+ - 1 件だけのシリーズにはナビゲーションを出力しません。
120
120
  - `series_order` は有限の数値である必要があります。数値文字列は変換しません。
121
121
  - シリーズ用のルートは生成しません。ランディングページを作る場合は `renderSeriesIndex()` を自前のページと組み合わせてください。
122
122
 
123
123
  ## 関連
124
124
 
125
- - [プラグインガイド](../../../docs/ja/reference/plugin-api.md)
125
+ - [プラグインガイド](../../../docs/ja/docs/reference/plugin-api.md)
126
+
package/dist/index.js CHANGED
@@ -250,14 +250,15 @@ function formatPosition(position, total) {
250
250
 
251
251
  // index.ts
252
252
  function series(options = {}) {
253
- const tracked = /* @__PURE__ */ new Map();
254
253
  return definePlugin({
255
254
  name: "series",
255
+ processedContentCache: {
256
+ version: "series-v1",
257
+ dependencyMode: "none"
258
+ },
259
+ outputDependencies: [{ type: "global" }],
256
260
  options,
257
261
  validateOptions: validateSeriesOptions,
258
- onPostProcessed: ({ slug, content }) => {
259
- tracked.set(slug, content);
260
- },
261
262
  onManifestCreated: ({ manifest, diagnostics }) => {
262
263
  diagnostics.push(...collectSeriesDiagnostics(manifest, options));
263
264
  const injected = /* @__PURE__ */ new Set();
@@ -273,10 +274,10 @@ function series(options = {}) {
273
274
  member.slug,
274
275
  options
275
276
  );
276
- entry.html = `${entry.html}
277
+ if (!entry.html.includes(navigation)) {
278
+ entry.html = `${entry.html}
277
279
  ${navigation}`;
278
- const content = tracked.get(member.slug);
279
- if (content) content.html = entry.html;
280
+ }
280
281
  }
281
282
  }
282
283
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-series",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,11 +15,11 @@
15
15
  "./style.css": "./style.css"
16
16
  },
17
17
  "dependencies": {
18
- "@riebeckite/core": "0.0.14"
18
+ "@riebeckite/core": "0.0.15"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsx": "^4.22.4",
22
- "@riebeckite/test": "0.0.14"
22
+ "@riebeckite/test": "0.0.15"
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public"