@xsynaptic/satteri-trailing-slash 0.1.0 → 0.2.0
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 +3 -10
- package/dist/index.d.mts +0 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
# @xsynaptic/satteri-trailing-slash
|
|
2
2
|
|
|
3
|
-
A [Sätteri][] hast plugin that normalizes trailing slashes on internal markdown links to match your
|
|
4
|
-
Astro project's [`trailingSlash`][astro-trailing-slash] setting. Hand-authored links like
|
|
5
|
-
`[text](/path)` emit whatever slash the author typed; when that disagrees with the site's canonical
|
|
6
|
-
form, each link costs a redirect hop. This rewrites them at compile time.
|
|
3
|
+
A [Sätteri][] hast plugin that normalizes trailing slashes on internal markdown links to match your Astro project's [`trailingSlash`][astro-trailing-slash] setting. Hand-authored links like `[text](/path)` emit whatever slash the author typed; when that disagrees with the site's canonical form, each link costs a redirect hop. This rewrites them at compile time.
|
|
7
4
|
|
|
8
|
-
Only internal root-relative `<a href>` links are touched, and any `?query`/`#hash` suffix is
|
|
9
|
-
preserved. External, protocol-relative (`//`), hash-only, `mailto:`/`tel:`, and file-extension links
|
|
10
|
-
are left alone, as are MDX components like `<Link>` (they aren't `<a>` nodes at hast time).
|
|
5
|
+
Only internal root-relative `<a href>` links are touched, and any `?query`/`#hash` suffix is preserved. External, protocol-relative (`//`), hash-only, `mailto:`/`tel:`, and file-extension links are left alone, as are MDX components like `<Link>` (they aren't `<a>` nodes at hast time).
|
|
11
6
|
|
|
12
7
|
## Install
|
|
13
8
|
|
|
@@ -19,9 +14,7 @@ This package is ESM-only.
|
|
|
19
14
|
|
|
20
15
|
## Use
|
|
21
16
|
|
|
22
|
-
Pass the same value your `astro.config` uses for `trailingSlash`. The one option, `trailingSlash`,
|
|
23
|
-
takes `'always'` (append a slash), `'never'` (strip it), or `'ignore'` (the default: a no-op, matching
|
|
24
|
-
Astro's own default).
|
|
17
|
+
Pass the same value your `astro.config` uses for `trailingSlash`. The one option, `trailingSlash`, takes `'always'` (append a slash), `'never'` (strip it), or `'ignore'` (the default: a no-op, matching Astro's own default).
|
|
25
18
|
|
|
26
19
|
```ts
|
|
27
20
|
import { satteri } from '@astrojs/markdown-satteri';
|
package/dist/index.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsynaptic/satteri-trailing-slash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Sätteri hast plugin that normalizes trailing slashes on internal markdown links to match an Astro project's trailingSlash setting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"hast",
|
|
21
21
|
"trailing-slash",
|
|
22
22
|
"astro",
|
|
23
|
+
"withastro",
|
|
23
24
|
"seo"
|
|
24
25
|
],
|
|
25
26
|
"main": "./dist/index.mjs",
|
|
@@ -35,14 +36,14 @@
|
|
|
35
36
|
],
|
|
36
37
|
"sideEffects": false,
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@types/hast": "^3.0.
|
|
39
|
+
"@types/hast": "^3.0.5",
|
|
39
40
|
"zod": "^4.4.3"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
|
-
"satteri": "^0.
|
|
43
|
+
"satteri": "^0.10.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"satteri": "^0.
|
|
46
|
+
"satteri": "^0.10.5"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "tsdown",
|