@riebeckite/plugin-archive 0.0.32 → 0.0.33
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 +9 -5
- package/README_ja.md +21 -18
- package/dist/index.d.ts +0 -1
- package/dist/index.js +4 -2
- package/package.json +9 -5
- package/style.css +69 -0
package/README.md
CHANGED
|
@@ -51,6 +51,10 @@ Each resolved page also sets `description` and `language`, so the site's
|
|
|
51
51
|
document frame can render archive SEO metadata and the `lang` attribute without
|
|
52
52
|
recomputing the period.
|
|
53
53
|
|
|
54
|
+
## Live example
|
|
55
|
+
|
|
56
|
+
[Open the October 2026 archive](/archive/2026/10)
|
|
57
|
+
|
|
54
58
|
## Options
|
|
55
59
|
|
|
56
60
|
| Option | Type | Default | Description |
|
|
@@ -62,7 +66,7 @@ recomputing the period.
|
|
|
62
66
|
|
|
63
67
|
## Exports
|
|
64
68
|
|
|
65
|
-
- `archive` / `
|
|
69
|
+
- `archive` / `archive` — the plugin factory.
|
|
66
70
|
- `resolveArchiveOptions` — resolves options with defaults.
|
|
67
71
|
- `buildArchiveCollections` — builds the monthly collections for entries.
|
|
68
72
|
- `archiveDefinitions` — the Core collection definitions used by the plugin.
|
|
@@ -74,7 +78,7 @@ recomputing the period.
|
|
|
74
78
|
|
|
75
79
|
## Notes
|
|
76
80
|
|
|
77
|
-
The plugin
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
The plugin includes a responsive archive stylesheet that uses the active theme's
|
|
82
|
+
color and typography tokens. Set `basePath` to a different prefix if `/archive`
|
|
83
|
+
clashes with existing content, and set it to `""` to turn the generated pages
|
|
84
|
+
off without removing the plugin.
|
package/README_ja.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
[English](./README.md)
|
|
6
6
|
|
|
7
|
-
Riebeckite
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Riebeckite の月別アーカイブ一覧ページを生成するプラグインです。一覧は Core の
|
|
8
|
+
collection 機構(`buildContentCollections`)で組み立てるため、リンク・順序・
|
|
9
|
+
ページネーションはサイト全体と同じクエリパイプラインを再利用します。
|
|
10
10
|
|
|
11
11
|
## インストール
|
|
12
12
|
|
|
@@ -26,32 +26,36 @@ export default {
|
|
|
26
26
|
|
|
27
27
|
## ページタイプ
|
|
28
28
|
|
|
29
|
-
`archive` という 1 つの
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
`archive` という 1 つの PageType を登録し、プラグインを有効にしている間だけ
|
|
30
|
+
ルートを生成します。ルートはアプリケーションコードではなくプラグインが生成
|
|
31
|
+
し、サイトのキャッチオールのコンテンツルートが配信します。専用のアプリケーション
|
|
32
32
|
ルートは不要です。
|
|
33
33
|
|
|
34
34
|
- `archive`: `<basePath>/<yyyy>/<mm>` に月ごとの一覧ページを、ページネー
|
|
35
35
|
ションがある場合は `<basePath>/<yyyy>/<mm>/page/<n>` に追加ページを生成
|
|
36
36
|
します。
|
|
37
37
|
|
|
38
|
-
エントリは `published`、`date`、`created`
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
エントリは `published`、`date`、`created` のうち最初に利用できる日付を月単位
|
|
39
|
+
でグループ化します。月は新しい順に並び、各リンクにはエントリの解決済みパーマ
|
|
40
|
+
リンクを使います。
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## 公開範囲と言語
|
|
43
43
|
|
|
44
44
|
一覧は `manifest.discoverableEntries` から組み立てるため、unlisted・下書き・
|
|
45
45
|
スケジュール公開のノートは現れません。期間タイトルと前後ページのラベルは
|
|
46
|
-
`site.locale`
|
|
46
|
+
`site.locale` に従います。プラグインの `locale` で上書きできます。日本語と英語
|
|
47
47
|
のラベルを用意し、期間は `Intl.DateTimeFormat` で任意のロケール向けに整形し
|
|
48
48
|
ます。`en_US` のようなアンダースコア区切りのロケールは整形前に正規化しま
|
|
49
49
|
す。
|
|
50
50
|
|
|
51
51
|
解決したページは `description` と `language` も設定するため、サイトの
|
|
52
|
-
|
|
52
|
+
ドキュメントフレームは期間を再計算せずにアーカイブの SEO メタデータと `lang` 属性
|
|
53
53
|
を描画できます。
|
|
54
54
|
|
|
55
|
+
## 実行例
|
|
56
|
+
|
|
57
|
+
[2026 年 10 月の Archive を開く](/archive/2026/10)
|
|
58
|
+
|
|
55
59
|
## オプション
|
|
56
60
|
|
|
57
61
|
| オプション | 型 | 既定値 | 説明 |
|
|
@@ -63,10 +67,10 @@ document frame は期間を再計算せずにアーカイブの SEO メタデー
|
|
|
63
67
|
|
|
64
68
|
## エクスポート
|
|
65
69
|
|
|
66
|
-
- `archive` / `
|
|
70
|
+
- `archive` / `archive`:プラグインファクトリ。
|
|
67
71
|
- `resolveArchiveOptions`:既定値を適用してオプションを解決します。
|
|
68
72
|
- `buildArchiveCollections`:エントリから月別 collection を組み立てます。
|
|
69
|
-
- `archiveDefinitions
|
|
73
|
+
- `archiveDefinitions`:プラグインが使う Core collection 定義。
|
|
70
74
|
- `renderArchivePage`:アーカイブ一覧ページを HTML に描画します。
|
|
71
75
|
- `formatArchivePeriod`、`archivePaginationLabels`、
|
|
72
76
|
`buildArchiveDescription`:ロケール補助関数。
|
|
@@ -75,7 +79,6 @@ document frame は期間を再計算せずにアーカイブの SEO メタデー
|
|
|
75
79
|
|
|
76
80
|
## 補足
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`""` を設定します。
|
|
82
|
+
プラグインには、有効なテーマの色と書体トークンを使うレスポンシブなアーカイブ
|
|
83
|
+
スタイルが含まれます。`/archive` が既存コンテンツと衝突する場合は `basePath` を
|
|
84
|
+
変更し、プラグインを残したまま生成ページを止めたい場合は `""` を設定します。
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,3 @@ export { renderArchivePage } from "./src/pages.js";
|
|
|
6
6
|
export type { ArchiveOptions, ArchivePage, ResolvedArchiveOptions, } from "./src/types.js";
|
|
7
7
|
export declare const ARCHIVE_PLUGIN_NAME = "archive";
|
|
8
8
|
export declare function archive(options?: ArchiveOptions): import("@riebeckite/core").RiebeckitePlugin<ArchiveOptions>;
|
|
9
|
-
export declare const archivePlugin: typeof archive;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// index.ts
|
|
2
2
|
import {
|
|
3
|
+
createStyleAsset,
|
|
3
4
|
definePlugin
|
|
4
5
|
} from "@riebeckite/core";
|
|
5
6
|
|
|
@@ -126,6 +127,9 @@ function archive(options = {}) {
|
|
|
126
127
|
return definePlugin({
|
|
127
128
|
name: ARCHIVE_PLUGIN_NAME,
|
|
128
129
|
options,
|
|
130
|
+
assets: [
|
|
131
|
+
createStyleAsset("archive", "@riebeckite/plugin-archive/style.css")
|
|
132
|
+
],
|
|
129
133
|
validateOptions: validateArchiveOptions,
|
|
130
134
|
pageTypes: [
|
|
131
135
|
{
|
|
@@ -159,7 +163,6 @@ function archive(options = {}) {
|
|
|
159
163
|
]
|
|
160
164
|
});
|
|
161
165
|
}
|
|
162
|
-
var archivePlugin = archive;
|
|
163
166
|
function resolveLocale(config, options) {
|
|
164
167
|
return options.locale ?? config?.site.locale ?? "en";
|
|
165
168
|
}
|
|
@@ -192,7 +195,6 @@ export {
|
|
|
192
195
|
archive,
|
|
193
196
|
archiveDefinitions,
|
|
194
197
|
archivePaginationLabels,
|
|
195
|
-
archivePlugin,
|
|
196
198
|
buildArchiveCollections,
|
|
197
199
|
buildArchiveDescription,
|
|
198
200
|
formatArchivePeriod,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-archive",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"source": "./index.ts",
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./style.css"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@riebeckite/core": "0.0.
|
|
18
|
+
"@riebeckite/core": "0.0.33"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"tsx": "^4.22.4"
|
|
@@ -26,7 +27,8 @@
|
|
|
26
27
|
"LICENSE",
|
|
27
28
|
"README.md",
|
|
28
29
|
"README_ja.md",
|
|
29
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"style.css"
|
|
30
32
|
],
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|
|
@@ -47,7 +49,9 @@
|
|
|
47
49
|
"engines": {
|
|
48
50
|
"node": "^20.19.0 || >=22.12.0"
|
|
49
51
|
},
|
|
50
|
-
"sideEffects":
|
|
52
|
+
"sideEffects": [
|
|
53
|
+
"./style.css"
|
|
54
|
+
],
|
|
51
55
|
"scripts": {
|
|
52
56
|
"build": "node ../../../scripts/build_package.mjs",
|
|
53
57
|
"test": "node --import tsx --test \"test/*.test.ts\""
|
package/style.css
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[data-rr-archive] {
|
|
2
|
+
margin-block: clamp(2rem, 6vw, 4.5rem);
|
|
3
|
+
color: var(--rb-color-ink);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-rr-archive] .rb-archive__title {
|
|
7
|
+
margin: 0 0 clamp(1.5rem, 4vw, 2.75rem);
|
|
8
|
+
padding-bottom: 0.75rem;
|
|
9
|
+
border-bottom: 2px solid var(--rb-color-accent);
|
|
10
|
+
font-family: var(--rb-font-heading, inherit);
|
|
11
|
+
font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
|
|
12
|
+
line-height: 1.1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[data-rr-archive] .rb-archive__list {
|
|
16
|
+
display: grid;
|
|
17
|
+
gap: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border-top: 1px solid var(--rb-color-border);
|
|
21
|
+
list-style: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[data-rr-archive] .rb-archive__item {
|
|
25
|
+
border-bottom: 1px solid var(--rb-color-border);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-rr-archive] .rb-archive__link {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
gap: 1rem;
|
|
33
|
+
padding: 1rem 0.25rem;
|
|
34
|
+
color: var(--rb-color-link, var(--rb-color-accent));
|
|
35
|
+
font-family: var(--rb-font-heading, inherit);
|
|
36
|
+
font-size: 1.1rem;
|
|
37
|
+
font-weight: 650;
|
|
38
|
+
line-height: 1.4;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-rr-archive] .rb-archive__link::after {
|
|
43
|
+
flex: none;
|
|
44
|
+
color: var(--rb-color-muted);
|
|
45
|
+
content: "→";
|
|
46
|
+
transition: transform 140ms ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-rr-archive] .rb-archive__link:hover {
|
|
50
|
+
color: var(--rb-color-accent);
|
|
51
|
+
background: var(--rb-color-surface-hover);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-rr-archive] .rb-archive__link:hover::after {
|
|
55
|
+
transform: translateX(0.25rem);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[data-rr-archive] .rb-archive__pagination {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-wrap: wrap;
|
|
61
|
+
gap: 0.75rem;
|
|
62
|
+
margin-top: 2rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-rr-archive] .rb-archive__pagination .rb-archive__link {
|
|
66
|
+
padding: 0.5rem 0.75rem;
|
|
67
|
+
border: 1px solid var(--rb-color-border-strong);
|
|
68
|
+
font-size: 0.9375rem;
|
|
69
|
+
}
|