@astrojs/starlight 0.25.1 → 0.25.2
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 +8 -0
- package/components/Icons.ts +2 -0
- package/integrations/asides.ts +8 -7
- package/package.json +2 -1
- package/schemas/social.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.25.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2126](https://github.com/withastro/starlight/pull/2126) [`ada51ee`](https://github.com/withastro/starlight/commit/ada51ee1500d07c1819059f57e97dc6e97b4d2ba) Thanks [@essential-randomness](https://github.com/essential-randomness)! - Adds support for markdown formatting in aside titles
|
|
8
|
+
|
|
9
|
+
- [#2135](https://github.com/withastro/starlight/pull/2135) [`9bbb969`](https://github.com/withastro/starlight/commit/9bbb9690616f79a80f3d286082b2500457bbcae9) Thanks [@oluwatobiss](https://github.com/oluwatobiss)! - Adds Pinterest social icon
|
|
10
|
+
|
|
3
11
|
## 0.25.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/components/Icons.ts
CHANGED
|
@@ -125,6 +125,8 @@ export const BuiltInIcons = {
|
|
|
125
125
|
'<path d="M12.102 0h-.081C5.462 0 .13 5.252.001 11.779v.012L.007 24l12.097-.01c6.582-.055 11.897-5.404 11.897-11.995S18.686.056 12.109 0h-.005zM12 18.857h-.015a6.778 6.778 0 0 1-2.94-.666l.041.018-4.345 1.077 1.227-4.018a6.78 6.78 0 0 1-.83-3.27A6.86 6.86 0 1 1 12 18.857z"/>',
|
|
126
126
|
zulip:
|
|
127
127
|
'<path d="M21 19c0 1.7-1.2 3-2.7 3H5.7C4.2 22 3 20.7 3 19a3 3 0 0 1 1.2-2.4l6.7-6c0-.1.3 0 .2.2l-2.5 5s0 .2.2.2h9.5c1.5 0 2.7 1.4 2.7 3Zm0-14a3 3 0 0 1-1.2 2.4l-6.7 6c0 .1-.2 0-.2-.2l2.5-5s0-.2-.2-.2H5.7C4.2 8 3 6.6 3 5c0-1.7 1.2-3 2.7-3h12.6C19.8 2 21 3.3 21 5Z"/>',
|
|
128
|
+
pinterest:
|
|
129
|
+
'<path d="M12 0a12 12 0 0 0-4.4 23.1c0-.9-.2-2.4 0-3.4l1.5-6s-.4-.7-.4-1.7c0-1.7 1-3 2.2-3 1 0 1.5.8 1.5 1.7 0 1-.6 2.6-1 4-.3 1.2.6 2.2 1.8 2.2 2.1 0 3.8-2.2 3.8-5.5 0-2.8-2-4.9-5-4.9a5.2 5.2 0 0 0-5.4 5.2c0 1 .3 2.2.8 2.8.1.1.2.2.1.3l-.3 1.4c0 .2-.2.3-.4.2-1.5-.7-2.4-3-2.4-4.7C4.4 8 7 4.5 12.3 4.5c4.1 0 7.4 3 7.4 6.9 0 4.1-2.6 7.4-6.3 7.4-1.2 0-2.3-.6-2.7-1.3l-.8 2.8c-.2 1-1 2.4-1.5 3.2A12 12 0 1 0 12 0z"/>',
|
|
128
130
|
astro:
|
|
129
131
|
'<path d="M7.233 15.856c-.456 1.5-.132 3.586.948 4.57v-.036l.036-.096c.132-.636.648-1.032 1.309-1.008.612.012.96.336 1.044 1.044.036.264.036.528.048.803v.084c0 .6.168 1.176.504 1.68.3.48.72.851 1.284 1.103l-.024-.048-.024-.096c-.42-1.26-.12-2.135.984-2.879l.336-.227.745-.492a3.647 3.647 0 0 0 1.536-2.603c.06-.456 0-.9-.132-1.331l-.18.12c-1.668.887-3.577 1.2-5.425.84-1.117-.169-2.197-.48-3-1.416l.011-.012ZM2 15.592s3.205-1.559 6.421-1.559l2.437-7.508c.084-.36.348-.6.648-.6.3 0 .552.24.648.612l2.425 7.496c3.816 0 6.421 1.56 6.421 1.56L15.539.72c-.144-.444-.42-.72-.768-.72H8.24c-.348 0-.6.276-.768.72L2 15.592Z"/>',
|
|
130
132
|
alpine: '<path d="m18.7 6 5.3 5.3-5.3 5.3-5.4-5.3L18.7 6zM5.3 6l11 11H5.8L0 11.2 5.3 6z"/>',
|
package/integrations/asides.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { AstroConfig, AstroIntegration, AstroUserConfig } from 'astro';
|
|
4
4
|
import { h as _h, s as _s, type Properties } from 'hastscript';
|
|
5
|
-
import type { Node, Paragraph as P, Parent, Root } from 'mdast';
|
|
5
|
+
import type { Node, Paragraph as P, Parent, PhrasingContent, Root } from 'mdast';
|
|
6
6
|
import {
|
|
7
7
|
type Directives,
|
|
8
8
|
directiveToMarkdown,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type LeafDirective,
|
|
11
11
|
} from 'mdast-util-directive';
|
|
12
12
|
import { toMarkdown } from 'mdast-util-to-markdown';
|
|
13
|
+
import { toString } from 'mdast-util-to-string';
|
|
13
14
|
import remarkDirective from 'remark-directive';
|
|
14
15
|
import type { Plugin, Transformer } from 'unified';
|
|
15
16
|
import { visit } from 'unist-util-visit';
|
|
@@ -156,16 +157,16 @@ function remarkAsides(options: AsidesOptions): Plugin<[], Root> {
|
|
|
156
157
|
// prop to <Aside>, so when we find a directive label, we store it for the title prop and
|
|
157
158
|
// remove the paragraph from the container’s children.
|
|
158
159
|
let title = t(`aside.${variant}`);
|
|
160
|
+
let titleNode: PhrasingContent[] = [{ type: 'text', value: title }];
|
|
159
161
|
const firstChild = node.children[0];
|
|
160
162
|
if (
|
|
161
163
|
firstChild?.type === 'paragraph' &&
|
|
162
164
|
firstChild.data &&
|
|
163
|
-
'directiveLabel' in firstChild.data
|
|
165
|
+
'directiveLabel' in firstChild.data &&
|
|
166
|
+
firstChild.children.length > 0
|
|
164
167
|
) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
title = firstGrandChild.value;
|
|
168
|
-
}
|
|
168
|
+
titleNode = firstChild.children;
|
|
169
|
+
title = toString(firstChild.children);
|
|
169
170
|
// The first paragraph contains a directive label, we can safely remove it.
|
|
170
171
|
node.children.splice(0, 1);
|
|
171
172
|
}
|
|
@@ -189,7 +190,7 @@ function remarkAsides(options: AsidesOptions): Plugin<[], Root> {
|
|
|
189
190
|
},
|
|
190
191
|
iconPaths[variant]
|
|
191
192
|
),
|
|
192
|
-
|
|
193
|
+
...titleNode,
|
|
193
194
|
]),
|
|
194
195
|
h('section', { class: 'starlight-aside__content' }, node.children),
|
|
195
196
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/starlight",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.2",
|
|
4
4
|
"description": "Build beautiful, high-performance documentation websites with Astro",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -195,6 +195,7 @@
|
|
|
195
195
|
"hastscript": "^9.0.0",
|
|
196
196
|
"mdast-util-directive": "^3.0.0",
|
|
197
197
|
"mdast-util-to-markdown": "^2.1.0",
|
|
198
|
+
"mdast-util-to-string": "^4.0.0",
|
|
198
199
|
"pagefind": "^1.0.3",
|
|
199
200
|
"rehype": "^13.0.1",
|
|
200
201
|
"rehype-format": "^5.0.0",
|
package/schemas/social.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const socialLinks = [
|
|
|
32
32
|
'blueSky',
|
|
33
33
|
'discourse',
|
|
34
34
|
'zulip',
|
|
35
|
+
'pinterest',
|
|
35
36
|
] as const;
|
|
36
37
|
|
|
37
38
|
export const SocialLinksSchema = () =>
|
|
@@ -79,6 +80,7 @@ export const SocialLinksSchema = () =>
|
|
|
79
80
|
blueSky: 'BlueSky',
|
|
80
81
|
discourse: 'Discourse',
|
|
81
82
|
zulip: 'Zulip',
|
|
83
|
+
pinterest: 'Pinterest',
|
|
82
84
|
}[key];
|
|
83
85
|
labelledLinks[key] = { label, url };
|
|
84
86
|
}
|