starlight-obsidian 0.11.0 → 0.12.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/CHANGELOG.md +10 -0
- package/index.ts +3 -3
- package/libs/rehype.ts +1 -2
- package/libs/remark.ts +3 -9
- package/package.json +17 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# starlight-obsidian
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#70](https://github.com/HiDeoo/starlight-obsidian/pull/70) [`877dbb6`](https://github.com/HiDeoo/starlight-obsidian/commit/877dbb65ac7beff9e3110db1ac1ba5ec936de342) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v6, drops support for Astro v5.
|
|
8
|
+
|
|
9
|
+
⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.38.0`.
|
|
10
|
+
|
|
11
|
+
Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs%2Fstarlight%400.38.0) to update your project.
|
|
12
|
+
|
|
3
13
|
## 0.11.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/index.ts
CHANGED
|
@@ -59,7 +59,7 @@ const starlightObsidianConfigSchema = z.object({
|
|
|
59
59
|
*/
|
|
60
60
|
singleDollarTextMath: z.boolean().default(true),
|
|
61
61
|
})
|
|
62
|
-
.
|
|
62
|
+
.prefault({}),
|
|
63
63
|
/**
|
|
64
64
|
* The name of the output directory containing the generated Obsidian vault pages relative to the `src/content/docs/`
|
|
65
65
|
* directory.
|
|
@@ -112,9 +112,9 @@ const starlightObsidianConfigSchema = z.object({
|
|
|
112
112
|
*
|
|
113
113
|
* @default 'Notes'
|
|
114
114
|
*/
|
|
115
|
-
label: z.union([z.string(), z.record(z.string())]).default('Notes'),
|
|
115
|
+
label: z.union([z.string(), z.record(z.string(), z.string())]).default('Notes'),
|
|
116
116
|
})
|
|
117
|
-
.
|
|
117
|
+
.prefault({}),
|
|
118
118
|
/**
|
|
119
119
|
* Determines if the table of contents top-level heading should be the Starlight default one ("Overview") or the page
|
|
120
120
|
* title.
|
package/libs/rehype.ts
CHANGED
|
@@ -15,8 +15,7 @@ export function rehypeStarlightObsidian() {
|
|
|
15
15
|
const lastChild = node.children.at(-1)
|
|
16
16
|
|
|
17
17
|
if (
|
|
18
|
-
|
|
19
|
-
lastChild.type !== 'element' ||
|
|
18
|
+
lastChild?.type !== 'element' ||
|
|
20
19
|
!(lastChild.tagName === 'p' || lastChild.tagName === 'ul' || lastChild.tagName === 'ol')
|
|
21
20
|
) {
|
|
22
21
|
return CONTINUE
|
package/libs/remark.ts
CHANGED
|
@@ -509,9 +509,7 @@ function getFrontmatterNodeValue(file: VFile, obsidianFrontmatter?: ObsidianFron
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
if (file.data.includeKatexStyles) {
|
|
512
|
-
|
|
513
|
-
frontmatter.head = []
|
|
514
|
-
}
|
|
512
|
+
frontmatter.head ??= []
|
|
515
513
|
|
|
516
514
|
frontmatter.head.push({
|
|
517
515
|
tag: 'link',
|
|
@@ -525,9 +523,7 @@ function getFrontmatterNodeValue(file: VFile, obsidianFrontmatter?: ObsidianFron
|
|
|
525
523
|
const ogImage = obsidianFrontmatter?.cover ?? obsidianFrontmatter?.image
|
|
526
524
|
|
|
527
525
|
if (ogImage && isAbsoluteUrl(ogImage)) {
|
|
528
|
-
|
|
529
|
-
frontmatter.head = []
|
|
530
|
-
}
|
|
526
|
+
frontmatter.head ??= []
|
|
531
527
|
|
|
532
528
|
if (!frontmatter.head.some((tag) => tag.attrs['property'] === 'og:image')) {
|
|
533
529
|
frontmatter.head.push({ tag: 'meta', attrs: { property: 'og:image', content: ogImage } })
|
|
@@ -632,9 +628,7 @@ function handleImagesWithSize(node: Image, context: VisitorContext, type: 'asset
|
|
|
632
628
|
} else {
|
|
633
629
|
const importId = generateAssetImportId()
|
|
634
630
|
|
|
635
|
-
|
|
636
|
-
context.file.data.assetImports = []
|
|
637
|
-
}
|
|
631
|
+
context.file.data.assetImports ??= []
|
|
638
632
|
|
|
639
633
|
context.file.data.assetImports.push([importId, node.url])
|
|
640
634
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-obsidian",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Starlight plugin to publish Obsidian vaults.",
|
|
6
6
|
"author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
|
|
@@ -17,43 +17,42 @@
|
|
|
17
17
|
"./package.json": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@astro-community/astro-embed-twitter": "^0.5.
|
|
21
|
-
"@astro-community/astro-embed-youtube": "^0.5.
|
|
20
|
+
"@astro-community/astro-embed-twitter": "^0.5.11",
|
|
21
|
+
"@astro-community/astro-embed-youtube": "^0.5.10",
|
|
22
22
|
"decode-uri-component": "^0.4.1",
|
|
23
23
|
"github-slugger": "^2.0.0",
|
|
24
|
-
"globby": "^
|
|
25
|
-
"hast-util-to-html": "^9.0.
|
|
26
|
-
"is-absolute-url": "^
|
|
27
|
-
"mdast-util-find-and-replace": "^3.0.
|
|
28
|
-
"mdast-util-from-markdown": "^2.0.
|
|
29
|
-
"mdast-util-to-hast": "^13.2.
|
|
30
|
-
"nanoid": "^5.
|
|
24
|
+
"globby": "^16.1.1",
|
|
25
|
+
"hast-util-to-html": "^9.0.5",
|
|
26
|
+
"is-absolute-url": "^5.0.0",
|
|
27
|
+
"mdast-util-find-and-replace": "^3.0.2",
|
|
28
|
+
"mdast-util-from-markdown": "^2.0.3",
|
|
29
|
+
"mdast-util-to-hast": "^13.2.1",
|
|
30
|
+
"nanoid": "^5.1.6",
|
|
31
31
|
"rehype": "^13.0.2",
|
|
32
32
|
"rehype-katex": "^7.0.1",
|
|
33
33
|
"rehype-mermaid": "^2.1.0",
|
|
34
34
|
"remark": "^15.0.1",
|
|
35
35
|
"remark-frontmatter": "^5.0.0",
|
|
36
|
-
"remark-gfm": "^4.0.
|
|
36
|
+
"remark-gfm": "^4.0.1",
|
|
37
37
|
"remark-math": "^6.0.0",
|
|
38
|
-
"unist-util-visit": "^5.
|
|
38
|
+
"unist-util-visit": "^5.1.0",
|
|
39
39
|
"vfile": "^6.0.3",
|
|
40
|
-
"yaml": "^2.
|
|
40
|
+
"yaml": "^2.8.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/hast": "^3.0.4",
|
|
44
44
|
"@types/mdast": "^4.0.4",
|
|
45
|
-
"@types/node": "^
|
|
45
|
+
"@types/node": "^22.19.15",
|
|
46
46
|
"@types/unist": "^3.0.3",
|
|
47
|
-
"typescript": "^5.
|
|
48
|
-
"vitest": "
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"vitest": "^4.0.18"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@astrojs/starlight": ">=0.34.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=22.12.0"
|
|
55
55
|
},
|
|
56
|
-
"packageManager": "pnpm@8.14.1",
|
|
57
56
|
"publishConfig": {
|
|
58
57
|
"access": "public"
|
|
59
58
|
},
|