@riebeckite/plugin-breadcrumbs 0.0.27 → 0.0.28
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 +6 -6
- package/dist/index.js +20 -2
- package/package.json +4 -4
package/README_ja.md
CHANGED
|
@@ -83,12 +83,12 @@ import "@riebeckite/plugin-breadcrumbs/style.css";
|
|
|
83
83
|
|
|
84
84
|
## エクスポート
|
|
85
85
|
|
|
86
|
-
- `breadcrumbs(options?)
|
|
87
|
-
- `breadcrumbsPlugin
|
|
88
|
-
- `resolveBreadcrumbsOptions(options?)
|
|
89
|
-
- `buildBreadcrumbItems({ manifest, entry, config, homeLabel })
|
|
90
|
-
- `renderBreadcrumbNav(items, options)
|
|
91
|
-
- `buildBreadcrumbJsonLd(config, items)
|
|
86
|
+
- `breadcrumbs(options?)`:プラグインファクトリ
|
|
87
|
+
- `breadcrumbsPlugin`:`breadcrumbs` のエイリアス
|
|
88
|
+
- `resolveBreadcrumbsOptions(options?)`:オプションの既定値を適用する
|
|
89
|
+
- `buildBreadcrumbItems({ manifest, entry, config, homeLabel })`:パンくず列を組み立てる
|
|
90
|
+
- `renderBreadcrumbNav(items, options)`:ナビゲーション HTML を生成する
|
|
91
|
+
- `buildBreadcrumbJsonLd(config, items)`:JSON-LD オブジェクトを生成する
|
|
92
92
|
- 型: `BreadcrumbsOptions`, `ResolvedBreadcrumbsOptions`, `BreadcrumbItem`
|
|
93
93
|
|
|
94
94
|
## 制約
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// index.ts
|
|
2
2
|
import {
|
|
3
3
|
createStyleAsset,
|
|
4
|
-
definePlugin
|
|
4
|
+
definePlugin,
|
|
5
|
+
resolvePublicFolderLocation as resolvePublicFolderLocation2
|
|
5
6
|
} from "@riebeckite/core";
|
|
6
7
|
|
|
7
8
|
// src/breadcrumbs.ts
|
|
@@ -184,7 +185,7 @@ function breadcrumbs(options = {}) {
|
|
|
184
185
|
version: "breadcrumbs-v1",
|
|
185
186
|
dependencyMode: "none"
|
|
186
187
|
},
|
|
187
|
-
|
|
188
|
+
resolveContentOutputDependencies: ({ entry, manifest }) => breadcrumbOutputDependencies(entry, manifest),
|
|
188
189
|
options,
|
|
189
190
|
validateOptions: validateBreadcrumbsOptions,
|
|
190
191
|
onManifestCreated: (context) => {
|
|
@@ -218,6 +219,23 @@ function breadcrumbs(options = {}) {
|
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
221
|
var breadcrumbsPlugin = breadcrumbs;
|
|
222
|
+
function breadcrumbOutputDependencies(entry, manifest) {
|
|
223
|
+
const segments = entry.publicLocation.permalink.split("/").filter(Boolean);
|
|
224
|
+
const dependencies = [];
|
|
225
|
+
for (let index = 0; index < segments.length - 1; index += 1) {
|
|
226
|
+
const pathname = `/${segments.slice(0, index + 1).join("/")}`;
|
|
227
|
+
const location = resolvePublicFolderLocation2(manifest, pathname);
|
|
228
|
+
if (location.type === "content") {
|
|
229
|
+
dependencies.push({ type: "public-location", pathname });
|
|
230
|
+
} else if (location.type === "generated") {
|
|
231
|
+
const folder = [...manifest.folderLocations.values()].find(
|
|
232
|
+
(candidate) => candidate.pathname === location.pathname
|
|
233
|
+
)?.folder;
|
|
234
|
+
if (folder) dependencies.push({ type: "folder", folder });
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return dependencies;
|
|
238
|
+
}
|
|
221
239
|
function validateBreadcrumbsOptions(options) {
|
|
222
240
|
if (!options) return [];
|
|
223
241
|
const issues = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-breadcrumbs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"hono": "^4.12.25",
|
|
25
|
-
"@riebeckite/core": "0.0.
|
|
26
|
-
"@riebeckite/ui": "0.0.
|
|
25
|
+
"@riebeckite/core": "0.0.28",
|
|
26
|
+
"@riebeckite/ui": "0.0.28"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"tsx": "^4.22.4",
|
|
30
|
-
"@riebeckite/test": "0.0.
|
|
30
|
+
"@riebeckite/test": "0.0.28"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|