starlight-versions 0.2.0 → 0.3.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.
@@ -13,12 +13,12 @@ import starlightVersionsConfig from 'virtual:starlight-versions-config'
13
13
 
14
14
  import { getVersionFromSlug, getVersionIdentifier, getVersionURL } from '../libs/versions'
15
15
 
16
- const { entry, labels } = Astro.props
16
+ const { entry } = Astro.props
17
17
 
18
18
  const pagefindTranslations = {
19
- placeholder: labels['search.label'],
19
+ placeholder: Astro.locals.t('search.label'),
20
20
  ...Object.fromEntries(
21
- Object.entries(labels)
21
+ Object.entries(Astro.locals.t.all())
22
22
  .filter(([key]) => key.startsWith('pagefind.'))
23
23
  .map(([key, value]) => [key.replace('pagefind.', ''), value]),
24
24
  ),
@@ -35,20 +35,20 @@ const pageVersionIdentifier = getVersionIdentifier(pageVersion)
35
35
  data-pagefind-filter={`version:${pageVersionIdentifier}`}
36
36
  >
37
37
  <button data-open-modal disabled>
38
- <Icon name="magnifier" label={labels['search.label']} />
39
- <span class="sl-hidden md:sl-block" aria-hidden="true">{labels['search.label']}</span>
40
- <Icon name="forward-slash" class="sl-hidden md:sl-block" label={labels['search.shortcutLabel']} />
38
+ <Icon name="magnifier" label={Astro.locals.t('search.label')} />
39
+ <span class="sl-hidden md:sl-block" aria-hidden="true">{Astro.locals.t('search.label')}</span>
40
+ <Icon name="forward-slash" class="sl-hidden md:sl-block" label={Astro.locals.t('search.shortcutLabel')} />
41
41
  </button>
42
42
 
43
- <dialog style="padding:0" aria-label={labels['search.label']}>
43
+ <dialog style="padding:0" aria-label={Astro.locals.t('search.label')}>
44
44
  <div class="dialog-frame sl-flex">
45
45
  <button data-close-modal class="sl-flex md:sl-hidden">
46
- {labels['search.cancelLabel']}
46
+ {Astro.locals.t('search.cancelLabel')}
47
47
  </button>
48
48
  {
49
49
  import.meta.env.DEV ? (
50
50
  <div style="margin: auto; text-align: center; white-space: pre-line;" dir="ltr">
51
- <p>{labels['search.devWarning']}</p>
51
+ <p>{Astro.locals.t('search.devWarning')}</p>
52
52
  </div>
53
53
  ) : (
54
54
  <div class="search-container">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-versions",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to version documentation pages.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
@@ -40,7 +40,7 @@
40
40
  "vitest": "^1.6.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@astrojs/starlight": ">=0.25.0"
43
+ "@astrojs/starlight": ">=0.28.0"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=18"