@astrojs/starlight 0.5.0 → 0.5.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 +18 -0
- package/components/Icons.ts +6 -0
- package/components/SocialIcons.astro +5 -0
- package/index.ts +4 -4
- package/package.json +1 -1
- package/translations/index.ts +2 -1
- package/translations/nb.json +22 -0
- package/utils/user-config.ts +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#343](https://github.com/withastro/starlight/pull/343) [`d618678`](https://github.com/withastro/starlight/commit/d618678b1901c621e1c8d2dc1a34ee299582b14e) Thanks [@delucis](https://github.com/delucis)! - Fix escaping of non-relative user config file paths for custom CSS and logos
|
|
8
|
+
|
|
9
|
+
## 0.5.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#336](https://github.com/withastro/starlight/pull/336) [`2b3302b`](https://github.com/withastro/starlight/commit/2b3302b80451f318fb05a5e8a7284feb28999e66) Thanks [@delucis](https://github.com/delucis)! - Add support for LinkedIn, Threads, and Twitch social icon links
|
|
14
|
+
|
|
15
|
+
- [#335](https://github.com/withastro/starlight/pull/335) [`757c65f`](https://github.com/withastro/starlight/commit/757c65ffc468fd2c782312b476fa7659d0cfd198) Thanks [@delucis](https://github.com/delucis)! - Fix relative path resolution on Windows
|
|
16
|
+
|
|
17
|
+
- [#332](https://github.com/withastro/starlight/pull/332) [`0600c1a`](https://github.com/withastro/starlight/commit/0600c1a917bf86efa6b2d053aa47e3a4b17e8049) Thanks [@sasoria](https://github.com/sasoria)! - Add Norwegian UI translations
|
|
18
|
+
|
|
19
|
+
- [#328](https://github.com/withastro/starlight/pull/328) [`e478848`](https://github.com/withastro/starlight/commit/e478848de1c41a46f58d0ac0d62d7b7272cf1241) Thanks [@astridx](https://github.com/astridx)! - Add missing accessible labels for Codeberg and YouTube social links
|
|
20
|
+
|
|
3
21
|
## 0.5.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/components/Icons.ts
CHANGED
|
@@ -64,4 +64,10 @@ export const Icons = {
|
|
|
64
64
|
'<path d="M12 .5a12 12 0 0 0-12 12 12 12 0 0 0 1.8 6.4l10-13a.2.1 0 0 1 .4 0l10 13a12 12 0 0 0 1.8-6.4 12 12 0 0 0-12-12zm.3 6.5 4.4 16.5a12 12 0 0 0 5.2-4.2z"/>',
|
|
65
65
|
youtube:
|
|
66
66
|
'<path d="M23.5 6.2A3 3 0 0 0 21.4 4c-1.9-.5-9.4-.5-9.4-.5s-7.5 0-9.4.5A3 3 0 0 0 .5 6.3C0 8 0 12 0 12s0 4 .5 5.8A3 3 0 0 0 2.6 20c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2c.5-2 .5-5.9.5-5.9s0-4-.5-5.8zm-14 9.4V8.4l6.3 3.6-6.3 3.6z"/>',
|
|
67
|
+
threads:
|
|
68
|
+
'<path d="m17.73 11.2-.29-.13c-.17-3.13-1.88-4.92-4.75-4.94h-.04c-1.72 0-3.14.73-4.02 2.06l1.58 1.09a2.8 2.8 0 0 1 2.47-1.21c.94 0 1.66.28 2.12.81.33.4.56.93.67 1.61-.84-.14-1.74-.18-2.71-.13-2.73.16-4.49 1.75-4.37 3.97a3.41 3.41 0 0 0 1.57 2.71c.81.54 1.85.8 2.93.74a4.32 4.32 0 0 0 3.33-1.62 6 6 0 0 0 1.14-2.97 3.5 3.5 0 0 1 1.46 1.6 4 4 0 0 1-.98 4.4c-1.3 1.3-2.86 1.85-5.21 1.87-2.62-.02-4.6-.86-5.88-2.5-1.2-1.52-1.82-3.73-1.85-6.56.03-2.83.65-5.04 1.85-6.57 1.29-1.63 3.26-2.47 5.88-2.49 2.63.02 4.64.86 5.97 2.5.66.8 1.15 1.82 1.48 3l1.85-.5c-.4-1.44-1.02-2.7-1.86-3.73-1.71-2.1-4.21-3.19-7.44-3.21h-.01c-3.22.02-5.7 1.1-7.35 3.22C3.79 6.1 3.03 8.72 3 11.99V12c.03 3.29.79 5.9 2.27 7.78 1.66 2.12 4.13 3.2 7.35 3.22h.01c2.86-.02 4.88-.77 6.54-2.43a5.95 5.95 0 0 0 1.4-6.56 5.62 5.62 0 0 0-2.84-2.81Zm-4.94 4.64c-1.2.07-2.44-.47-2.5-1.62-.05-.85.6-1.8 2.57-1.92l.67-.02c.71 0 1.38.07 1.99.2-.23 2.84-1.56 3.3-2.73 3.36Z"/>',
|
|
69
|
+
linkedin:
|
|
70
|
+
'<path d="M20.47 2H3.53a1.45 1.45 0 0 0-1.47 1.43v17.14A1.45 1.45 0 0 0 3.53 22h16.94a1.45 1.45 0 0 0 1.47-1.43V3.43A1.45 1.45 0 0 0 20.47 2ZM8.09 18.74h-3v-9h3v9ZM6.59 8.48a1.56 1.56 0 0 1 0-3.12 1.57 1.57 0 1 1 0 3.12Zm12.32 10.26h-3v-4.83c0-1.21-.43-2-1.52-2A1.65 1.65 0 0 0 12.85 13a2 2 0 0 0-.1.73v5h-3v-9h3V11a3 3 0 0 1 2.71-1.5c2 0 3.45 1.29 3.45 4.06v5.18Z"/>',
|
|
71
|
+
twitch:
|
|
72
|
+
'<path d="M2.5 1 1 4.8v15.4h5.5V23h3.1l3-2.8H17l6-5.7V1H2.6ZM21 13.5l-3.4 3.3H12l-3 2.8v-2.8H4.5V3H21v10.5Zm-3.4-6.8v5.8h-2V6.7h2Zm-5.5 0v5.8h-2V6.7h2Z"/>',
|
|
67
73
|
};
|
|
@@ -9,6 +9,11 @@ const labels: Record<Platform, string> = {
|
|
|
9
9
|
discord: 'Discord',
|
|
10
10
|
twitter: 'Twitter',
|
|
11
11
|
mastodon: 'Mastodon',
|
|
12
|
+
codeberg: 'Codeberg',
|
|
13
|
+
youtube: 'YouTube',
|
|
14
|
+
threads: 'Threads',
|
|
15
|
+
linkedin: 'LinkedIn',
|
|
16
|
+
twitch: 'Twitch',
|
|
12
17
|
};
|
|
13
18
|
|
|
14
19
|
const links = Object.entries(config.social || {}).filter(([, url]) =>
|
package/index.ts
CHANGED
|
@@ -89,19 +89,19 @@ function vitePluginStarlightUserConfig(
|
|
|
89
89
|
{ root }: AstroConfig
|
|
90
90
|
): NonNullable<ViteUserConfig['plugins']>[number] {
|
|
91
91
|
const resolveRelativeId = (id: string) =>
|
|
92
|
-
id.startsWith('.') ? resolve(fileURLToPath(root), id) : id;
|
|
92
|
+
JSON.stringify(id.startsWith('.') ? resolve(fileURLToPath(root), id) : id);
|
|
93
93
|
const modules = {
|
|
94
94
|
'virtual:starlight/user-config': `export default ${JSON.stringify(opts)}`,
|
|
95
95
|
'virtual:starlight/project-context': `export default ${JSON.stringify({
|
|
96
96
|
root,
|
|
97
97
|
})}`,
|
|
98
98
|
'virtual:starlight/user-css': opts.customCss
|
|
99
|
-
.map((id) => `import
|
|
99
|
+
.map((id) => `import ${resolveRelativeId(id)};`)
|
|
100
100
|
.join(''),
|
|
101
101
|
'virtual:starlight/user-images': opts.logo
|
|
102
102
|
? 'src' in opts.logo
|
|
103
|
-
? `import src from
|
|
104
|
-
: `import dark from
|
|
103
|
+
? `import src from ${resolveRelativeId(opts.logo.src)}; export const logos = { dark: src, light: src };`
|
|
104
|
+
: `import dark from ${resolveRelativeId(opts.logo.dark)}; import light from ${resolveRelativeId(opts.logo.light)}; export const logos = { dark, light };`
|
|
105
105
|
: 'export const logos = {};',
|
|
106
106
|
};
|
|
107
107
|
const resolutionMap = Object.fromEntries(
|
package/package.json
CHANGED
package/translations/index.ts
CHANGED
|
@@ -11,11 +11,12 @@ import nl from './nl.json';
|
|
|
11
11
|
import da from './da.json';
|
|
12
12
|
import tr from './tr.json';
|
|
13
13
|
import ar from './ar.json';
|
|
14
|
+
import nb from './nb.json';
|
|
14
15
|
|
|
15
16
|
const { parse } = builtinI18nSchema();
|
|
16
17
|
|
|
17
18
|
export default Object.fromEntries(
|
|
18
|
-
Object.entries({ cs, en, es, de, ja, pt, fr, it, nl, da, tr, ar }).map(([key, dict]) => [
|
|
19
|
+
Object.entries({ cs, en, es, de, ja, pt, fr, it, nl, da, tr, ar, nb }).map(([key, dict]) => [
|
|
19
20
|
key,
|
|
20
21
|
parse(dict),
|
|
21
22
|
])
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skipLink.label": "Gå til innholdet",
|
|
3
|
+
"search.label": "Søk",
|
|
4
|
+
"search.shortcutLabel": "(Trykk / for å søke)",
|
|
5
|
+
"search.cancelLabel": "Avbryt",
|
|
6
|
+
"search.devWarning": "Søk er bare tilgjengelig i produksjonsbygg. \nPrøv å bygg siden og forhåndsvis den for å teste det lokalt.",
|
|
7
|
+
"themeSelect.accessibleLabel": "Velg tema",
|
|
8
|
+
"themeSelect.dark": "Mørk",
|
|
9
|
+
"themeSelect.light": "Lys",
|
|
10
|
+
"themeSelect.auto": "Auto",
|
|
11
|
+
"languageSelect.accessibleLabel": "Velg språk",
|
|
12
|
+
"menuButton.accessibleLabel": "Meny",
|
|
13
|
+
"sidebarNav.accessibleLabel": "Hovednavigasjon",
|
|
14
|
+
"tableOfContents.onThisPage": "På denne siden",
|
|
15
|
+
"tableOfContents.overview": "Oversikt",
|
|
16
|
+
"i18n.untranslatedContent": "Dette innholdet er ikke tilgjengelig på ditt språk.",
|
|
17
|
+
"page.editLink": "Rediger side",
|
|
18
|
+
"page.lastUpdated": "Sist oppdatert:",
|
|
19
|
+
"page.previousLink": "Forrige",
|
|
20
|
+
"page.nextLink": "Neste",
|
|
21
|
+
"404.text": "Siden ble ikke funnet. Sjekk URL-en eller prøv å bruke søkefeltet."
|
|
22
|
+
}
|
package/utils/user-config.ts
CHANGED
|
@@ -53,14 +53,14 @@ const AutoSidebarGroupSchema = SidebarGroupSchema.extend({
|
|
|
53
53
|
directory: z.string(),
|
|
54
54
|
/**
|
|
55
55
|
* Whether the autogenerated subgroups should be collapsed by default.
|
|
56
|
-
* Defaults to the `AutoSidebarGroup` `collapsed` value.
|
|
56
|
+
* Defaults to the `AutoSidebarGroup` `collapsed` value.
|
|
57
57
|
*/
|
|
58
58
|
collapsed: z.boolean().optional(),
|
|
59
59
|
// TODO: not supported by Docusaurus but would be good to have
|
|
60
60
|
/** How many directories deep to include from this directory in the sidebar. Default: `Infinity`. */
|
|
61
61
|
// depth: z.number().optional(),
|
|
62
|
-
})
|
|
63
|
-
})
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
64
|
export type AutoSidebarGroup = z.infer<typeof AutoSidebarGroupSchema>;
|
|
65
65
|
|
|
66
66
|
type ManualSidebarGroupInput = z.input<typeof SidebarGroupSchema> & {
|
|
@@ -96,7 +96,7 @@ const ManualSidebarGroupSchema: z.ZodType<
|
|
|
96
96
|
])
|
|
97
97
|
.array()
|
|
98
98
|
),
|
|
99
|
-
})
|
|
99
|
+
});
|
|
100
100
|
|
|
101
101
|
const SidebarItemSchema = z.union([
|
|
102
102
|
SidebarLinkItemSchema,
|
|
@@ -139,6 +139,12 @@ const UserConfigSchema = z.object({
|
|
|
139
139
|
codeberg: z.string().url().optional(),
|
|
140
140
|
/** Link to the Youtube channel for this site, e.g. `'https://www.youtube.com/@astrodotbuild'`. */
|
|
141
141
|
youtube: z.string().url().optional(),
|
|
142
|
+
/** Link to the Threads profile for this site, e.g. `'https://www.threads.net/@nmoodev'`. */
|
|
143
|
+
threads: z.string().url().optional(),
|
|
144
|
+
/** Link to the LinkedIn page for this site, e.g. `'https://www.linkedin.com/company/astroinc'`. */
|
|
145
|
+
linkedin: z.string().url().optional(),
|
|
146
|
+
/** Link to the Twitch profile or repository for this site, e.g. `'https://www.twitch.tv/bholmesdev'`. */
|
|
147
|
+
twitch: z.string().url().optional(),
|
|
142
148
|
})
|
|
143
149
|
.optional(),
|
|
144
150
|
|
|
@@ -252,8 +258,8 @@ const UserConfigSchema = z.object({
|
|
|
252
258
|
.default(false)
|
|
253
259
|
.describe(
|
|
254
260
|
'Define if the last update date should be visible in the page footer.'
|
|
255
|
-
|
|
256
|
-
|
|
261
|
+
),
|
|
262
|
+
|
|
257
263
|
/** Define if the previous and next page links should be visible in the page footer. */
|
|
258
264
|
pagination: z
|
|
259
265
|
.boolean()
|