starlight-theme-nova 0.4.0 → 0.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-theme-nova",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "description": "",
6
6
  "author": "ocavue <ocavue@gmail.com>",
7
7
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "shiki-twoslash-renderer": "0.0.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@astrojs/starlight": "^0.32.5",
39
+ "@astrojs/starlight": "^0.33.0",
40
40
  "@iconify-json/bxl": "^1.2.2",
41
41
  "@iconify-json/logos": "^1.2.4",
42
42
  "@iconify-json/lucide": "^1.2.34",
@@ -2,18 +2,24 @@
2
2
  import { Icon } from '@astrojs/starlight/components'
3
3
  import config from 'virtual:starlight/user-config'
4
4
 
5
- type Platform = keyof NonNullable<typeof config.social>
6
- type SocialConfig = NonNullable<NonNullable<typeof config.social>[Platform]>
7
- const links = Object.entries(config.social || {}) as [Platform, SocialConfig][]
5
+ const links = config.social || []
6
+
7
+ if (!Array.isArray(links)) {
8
+ const message =
9
+ '[starlight-theme-nova] ' +
10
+ 'Starlight v0.33.0 changed the `social` configuration syntax. Please specify an array of link items instead of an object.\n' +
11
+ 'See the Starlight changelog for details: https://github.com/withastro/starlight/blob/cf3cec1b/packages/starlight/CHANGELOG.md#0330\n'
12
+ throw new Error(message)
13
+ }
8
14
  ---
9
15
 
10
16
  {
11
17
  links.length > 0 && (
12
18
  <>
13
- {links.map(([platform, { label, url }]) => (
14
- <a href={url} rel="me" class="nova-social-icons-link">
19
+ {links.map(({ label, href, icon }) => (
20
+ <a href={href} rel="me" class="nova-social-icons-link">
15
21
  <span class="sr-only">{label}</span>
16
- <Icon name={platform} size="1rem" color="currentColor" />
22
+ <Icon name={icon} size="1rem" color="currentColor" />
17
23
  </a>
18
24
  ))}
19
25
  </>