@astrojs/starlight 0.33.0 → 0.33.1
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/package.json +1 -1
- package/utils/head.ts +23 -0
- package/utils/user-config.ts +7 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.33.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3088](https://github.com/withastro/starlight/pull/3088) [`1885049`](https://github.com/withastro/starlight/commit/18850491905fc1bf9e467b1d65c7f1709daf3c30) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a regression in Starlight version `0.33.0` that caused the description and links to language alternates for multilingual websites to be missing from the` <head>` of the page.
|
|
8
|
+
|
|
9
|
+
- [#3065](https://github.com/withastro/starlight/pull/3065) [`463adf5`](https://github.com/withastro/starlight/commit/463adf53b263a963736cb441bc1dd515f3c81894) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Updates the `social` configuration option TSDoc example to match the shape of the expected value.
|
|
10
|
+
|
|
3
11
|
## 0.33.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/package.json
CHANGED
package/utils/head.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { type HeadConfig, HeadConfigSchema, type HeadUserConfig } from '../schem
|
|
|
5
5
|
import type { PageProps, RouteDataContext } from './routing/data';
|
|
6
6
|
import { fileWithBase } from './base';
|
|
7
7
|
import { formatCanonical } from './canonical';
|
|
8
|
+
import { localizedUrl } from './localizedUrl';
|
|
8
9
|
|
|
9
10
|
const HeadSchema = HeadConfigSchema();
|
|
10
11
|
|
|
@@ -61,6 +62,28 @@ export function getHead(
|
|
|
61
62
|
},
|
|
62
63
|
];
|
|
63
64
|
|
|
65
|
+
if (description)
|
|
66
|
+
headDefaults.push({
|
|
67
|
+
tag: 'meta',
|
|
68
|
+
attrs: { name: 'description', content: description },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Link to language alternates.
|
|
72
|
+
if (canonical && config.isMultilingual) {
|
|
73
|
+
for (const locale in config.locales) {
|
|
74
|
+
const localeOpts = config.locales[locale];
|
|
75
|
+
if (!localeOpts) continue;
|
|
76
|
+
headDefaults.push({
|
|
77
|
+
tag: 'link',
|
|
78
|
+
attrs: {
|
|
79
|
+
rel: 'alternate',
|
|
80
|
+
hreflang: localeOpts.lang,
|
|
81
|
+
href: localizedUrl(canonical, locale, project.trailingSlash).href,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
64
87
|
// Link to sitemap, but only when `site` is set.
|
|
65
88
|
if (context.site) {
|
|
66
89
|
headDefaults.push({
|
package/utils/user-config.ts
CHANGED
|
@@ -51,18 +51,13 @@ const UserConfigSchema = z.object({
|
|
|
51
51
|
* Optional details about the social media accounts for this site.
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
|
-
* social:
|
|
55
|
-
* codeberg: 'https://codeberg.org/knut
|
|
56
|
-
* discord: 'https://astro.build/chat',
|
|
57
|
-
* github: 'https://github.com/withastro
|
|
58
|
-
* gitlab: 'https://gitlab.com/delucis',
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* threads: 'https://www.threads.net/@nmoodev',
|
|
62
|
-
* twitch: 'https://www.twitch.tv/bholmesdev',
|
|
63
|
-
* twitter: 'https://twitter.com/astrodotbuild',
|
|
64
|
-
* youtube: 'https://youtube.com/@astrodotbuild',
|
|
65
|
-
* }
|
|
54
|
+
* social: [
|
|
55
|
+
* { icon: 'codeberg', label: 'Codeberg', href: 'https://codeberg.org/knut' },
|
|
56
|
+
* { icon: 'discord', label: 'Discord', href: 'https://astro.build/chat' },
|
|
57
|
+
* { icon: 'github', label: 'GitHub', href: 'https://github.com/withastro' },
|
|
58
|
+
* { icon: 'gitlab', label: 'GitLab', href: 'https://gitlab.com/delucis' },
|
|
59
|
+
* { icon: 'mastodon', label: 'Mastodon', href: 'https://m.webtoo.ls/@astro' },
|
|
60
|
+
* ]
|
|
66
61
|
*/
|
|
67
62
|
social: SocialLinksSchema(),
|
|
68
63
|
|