@riebeckite/plugin-alias 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 +4 -4
- package/README_ja.md +8 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -30,18 +30,18 @@ Redirects are written into the build-time manifest and resolved by HonoX at requ
|
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
import { defineConfig } from "@riebeckite/core";
|
|
33
|
-
import {
|
|
33
|
+
import { alias } from "@riebeckite/plugin-alias";
|
|
34
34
|
|
|
35
35
|
export default defineConfig({
|
|
36
36
|
// ...
|
|
37
|
-
plugins: [
|
|
37
|
+
plugins: [alias()],
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
It composes with the `permalink` plugin. `alias` augments already-resolved public locations through `extendContentLocations`, so it never overrides or re-derives the canonical permalink, whatever decided it.
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
plugins: [
|
|
44
|
+
plugins: [permalink(), alias()],
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## Options
|
|
@@ -80,7 +80,7 @@ A colliding alias is not registered; the existing path wins.
|
|
|
80
80
|
|
|
81
81
|
## Exports
|
|
82
82
|
|
|
83
|
-
- `
|
|
83
|
+
- `alias(options?)` / `alias(options?)` — the plugin factory
|
|
84
84
|
- `resolveAliasPath(alias)` — pure alias-to-path helper (returns `null` when invalid)
|
|
85
85
|
- Types: `AliasOptions`, `AliasRedirectStatus`, `ResolvedAliasOptions`
|
|
86
86
|
|
package/README_ja.md
CHANGED
|
@@ -6,7 +6,7 @@ Obsidian の frontmatter `aliases`(`alias` も可)を、サイト内のリ
|
|
|
6
6
|
|
|
7
7
|
[English](./README.md)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 概要
|
|
10
10
|
|
|
11
11
|
Vault のノートが
|
|
12
12
|
|
|
@@ -30,18 +30,18 @@ aliases:
|
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
import { defineConfig } from "@riebeckite/core";
|
|
33
|
-
import {
|
|
33
|
+
import { alias } from "@riebeckite/plugin-alias";
|
|
34
34
|
|
|
35
35
|
export default defineConfig({
|
|
36
36
|
// ...
|
|
37
|
-
plugins: [
|
|
37
|
+
plugins: [alias()],
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
`permalink` プラグインと併用できます。`alias`
|
|
41
|
+
`permalink` プラグインと併用できます。`alias` は解決済みの公開ロケーションを `extendContentLocations` で後から拡張するため、正規パーマリンクがどのように決まっていても、その値を上書きしたり再現したりしません。
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
plugins: [
|
|
44
|
+
plugins: [permalink(), alias()],
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
## オプション
|
|
@@ -52,7 +52,7 @@ plugins: [permalinkPlugin(), aliasPlugin()],
|
|
|
52
52
|
|
|
53
53
|
## エイリアスの正規化
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
エイリアスはノートの別名として扱い、サイトルートからのパスに変換します。
|
|
56
56
|
|
|
57
57
|
- 先頭の `/` は無視します(`Old` も `/Old` も `/Old` になります)。
|
|
58
58
|
- パス区切り `/` による階層を許可します(`archive/Old` → `/archive/Old`)。
|
|
@@ -74,13 +74,13 @@ plugins: [permalinkPlugin(), aliasPlugin()],
|
|
|
74
74
|
|
|
75
75
|
## 制限事項
|
|
76
76
|
|
|
77
|
-
-
|
|
77
|
+
- リダイレクトはビルド時に確定します。エイリアスを追加・変更したときは、サイトを再ビルドしてください。
|
|
78
78
|
- SSG ではリダイレクト専用の HTML ファイルは生成されません。リダイレクトはサーバー(HonoX の `resolveContentRoute`)が解決します。
|
|
79
79
|
- エイリアスはコンテンツグラフ(バックリンク)には含まれません。元の Markdown に書かれたリンクだけが対象です。
|
|
80
80
|
|
|
81
81
|
## エクスポート
|
|
82
82
|
|
|
83
|
-
- `
|
|
83
|
+
- `alias(options?)` / `alias(options?)`:プラグインファクトリ
|
|
84
84
|
- `resolveAliasPath(alias)`:エイリアスをサイト内パスへ変換する純関数(`null` で無効)
|
|
85
85
|
- 型: `AliasOptions`、`AliasRedirectStatus`、`ResolvedAliasOptions`
|
|
86
86
|
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,3 @@ export { resolveAliasPath } from "./src/alias.js";
|
|
|
10
10
|
* redirect entries on top of whatever `permalink` resolved.
|
|
11
11
|
*/
|
|
12
12
|
export declare function alias(options?: AliasOptions): import("@riebeckite/core").RiebeckitePlugin<unknown>;
|
|
13
|
-
export declare const aliasPlugin: typeof alias;
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,6 @@ function alias(options = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
var aliasPlugin = alias;
|
|
49
48
|
function applyAliases(context, options) {
|
|
50
49
|
const owners = /* @__PURE__ */ new Map();
|
|
51
50
|
for (const location of context.locations.values()) {
|
|
@@ -101,6 +100,5 @@ function reservePath(owners, path, slug, kind) {
|
|
|
101
100
|
}
|
|
102
101
|
export {
|
|
103
102
|
alias,
|
|
104
|
-
aliasPlugin,
|
|
105
103
|
resolveAliasPath
|
|
106
104
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-alias",
|
|
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",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@riebeckite/core": "0.0.
|
|
17
|
+
"@riebeckite/core": "0.0.33"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"@riebeckite/test": "0.0.33",
|
|
21
|
+
"tsx": "^4.22.4"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|