Skip to content

Commit d5c3954

Browse files
committed
Revert "address breaking changes"
This reverts commit bf31efd.
1 parent cf1e881 commit d5c3954

20 files changed

+46
-44
lines changed

src/components/AwesomeTauri.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
const { section } = Astro.locals.starlightRoute;
2+
const { section } = Astro.props;
33
import { createMarkdownProcessor } from '@astrojs/markdown-remark';
44
import { JSDOM } from 'jsdom';
55
import { join, dirname } from 'path';

src/components/BookItem.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import { Image } from 'astro:assets';
33
4-
const { image, alt = 'Book Cover', title, author, links = [] } = Astro.locals.starlightRoute;
4+
const { image, alt = 'Book Cover', title, author, links = [] } = Astro.props;
55
66
interface Props {
77
image: ImageMetadata;

src/components/CardGridSearch.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
interface Props {
99
placeholder?: string;
1010
}
11-
const { placeholder = 'Search features and community resources...' } = Astro.locals.starlightRoute;
11+
const { placeholder = 'Search features and community resources...' } = Astro.props;
1212
1313
// TODO: Expose placeholder and title to i18n
1414
---

src/components/CommandTabs.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props {
1111
cargo?: string;
1212
}
1313
14-
const { npm, yarn, pnpm, bun, cargo, deno } = Astro.locals.starlightRoute;
14+
const { npm, yarn, pnpm, bun, cargo, deno } = Astro.props;
1515
---
1616

1717
<Tabs syncKey="cmd">

src/components/PluginLinks.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface Props {
55
plugin: Plugin;
66
showJsLinks?: boolean;
77
}
8-
const { plugin, showJsLinks = true } = Astro.locals.starlightRoute;
8+
const { plugin, showJsLinks = true } = Astro.props;
99
const github = `https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/${plugin}`;
1010
const npm = showJsLinks ? `https://www.npmjs.com/package/@tauri-apps/plugin-${plugin}` : undefined;
1111
const cratesio = `https://crates.io/crates/tauri-plugin-${plugin}`;

src/components/PluginPermissions.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
plugin: string;
99
}
1010
11-
const { plugin } = Astro.locals.starlightRoute;
11+
const { plugin } = Astro.props;
1212
1313
async function importMDX(plugin: string): Promise<string> {
1414
const base = fileURLToPath(import.meta.url);

src/components/ShowSolution.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
let { text } = Astro.locals.starlightRoute;
2+
let { text } = Astro.props;
33
text = text ?? 'Show solution';
44
---
55

src/components/SinceVersion.astro

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ interface Props {
2828
* overrides the link to release page
2929
*
3030
* if the `library` prop is defined, `href` defaults to:
31-
* - `${Astro.url.origin}/release/${Astro.locals.starlightRoute.library}/v${Astro.locals.starlightRoute.version}`
31+
* - `${Astro.url.origin}/release/${Astro.props.library}/v${Astro.props.version}`
3232
*
3333
* if the `library` prop is `undefined`, `href` defaults to:
34-
* - defaults to `${Astro.url.origin}/release/tauri/v${Astro.locals.starlightRoute.version}`
34+
* - defaults to `${Astro.url.origin}/release/tauri/v${Astro.props.version}`
3535
*/
3636
href?: string;
3737
}
3838
---
3939

4040
<a
4141
class="not-content"
42-
href={Astro.locals.starlightRoute.href
43-
? Astro.locals.starlightRoute.href
44-
: Astro.locals.starlightRoute.library
45-
? `${Astro.url.origin}/release/${Astro.locals.starlightRoute.library}/v${Astro.locals.starlightRoute.version}`
46-
: `${Astro.url.origin}/release/tauri/v${Astro.locals.starlightRoute.version}`}
42+
href={Astro.props.href
43+
? Astro.props.href
44+
: Astro.props.library
45+
? `${Astro.url.origin}/release/${Astro.props.library}/v${Astro.props.version}`
46+
: `${Astro.url.origin}/release/tauri/v${Astro.props.version}`}
4747
target="_blank"
4848
>
49-
<Icon name="seti:clock" />Since <code>{Astro.locals.starlightRoute.version}</code>
49+
<Icon name="seti:clock" />Since <code>{Astro.props.version}</code>
5050
</a>
5151

5252
<style>

src/components/UpgradeBadge.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface Props extends HTMLAttributes<'a'> {}
77
---
88

99
<div>
10-
<a class="not-content">Tauri 1.0 Upgrade Guide <Icon name="rocket" /></a>
10+
<a class="not-content" {...Astro.props}>Tauri 1.0 Upgrade Guide <Icon name="rocket" /></a>
1111
</div>
1212

1313
<style>

src/components/list/Directory.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ function compareOrder(a: Route, b: Route): boolean {
5050
return a.entry.data.sidebar.order > b.entry.data.sidebar.order;
5151
}
5252
53-
let { slug } = Astro.locals.starlightRoute;
53+
let { slug } = Astro.props;
5454
const {
5555
filterOutByTitle = [],
5656
filterOutByFileName = [],
5757
sortAlphabetically = false,
5858
callback,
59-
} = Astro.locals.starlightRoute;
59+
} = Astro.props;
6060
6161
const defaultLocale = config.defaultLocale.lang || 'en';
6262
const localesList = config.isMultilingual ? Object.keys(config.locales) : [defaultLocale];

src/components/overrides/Footer.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
2+
import type { Props } from '@astrojs/starlight/props';
33
import Default from '@astrojs/starlight/components/Footer.astro';
44
const year = new Date().getFullYear();
55
---
66

7-
<Default ><slot /></Default>
7+
<Default {...Astro.props}><slot /></Default>
88

99
<hr />
1010

src/components/overrides/Header.astro

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
2+
import type { Props } from '@astrojs/starlight/props';
33
import LanguageSelect from '@astrojs/starlight/components/LanguageSelect.astro';
44
import Search from '@astrojs/starlight/components/Search.astro';
55
import SiteTitle from './SiteTitle.astro';
66
import SocialIcons from '@astrojs/starlight/components/SocialIcons.astro';
77
import ThemeSelect from './ThemeSelect.astro';
88
9-
const curLocale = Astro.locals.starlightRoute.locale;
9+
const curLocale = Astro.props.locale;
1010
1111
1212
type Link = {
@@ -41,10 +41,10 @@ const links: Link[] = [
4141

4242
<div class="header sl-flex">
4343
<div class="full-width sl-flex">
44-
<SiteTitle />
44+
<SiteTitle {...Astro.props} />
4545
</div>
4646
<div class="sl-flex">
47-
<Search />
47+
<Search {...Astro.props} />
4848
</div>
4949
<div class="sl-hidden md:sl-flex right-group">
5050
<div class="desktop">
@@ -57,10 +57,10 @@ const links: Link[] = [
5757
}
5858
</div>
5959
<div class="sl-flex social-icons">
60-
<SocialIcons />
60+
<SocialIcons {...Astro.props} />
6161
</div>
62-
<LanguageSelect />
63-
<ThemeSelect />
62+
<LanguageSelect {...Astro.props} />
63+
<ThemeSelect {...Astro.props} />
6464
</div>
6565
</div>
6666

@@ -136,7 +136,7 @@ body[data-mobile-menu-expanded] header {
136136
</style>
137137

138138
{
139-
Astro.locals.starlightRoute.entry.slug === '' || Astro.locals.starlightRoute.locale === Astro.locals.starlightRoute.entry.slug ?
139+
Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ?
140140
<style>
141141
.header {
142142
background-color: transparent;

src/components/overrides/PageFrame.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
import MobileMenuToggle from 'virtual:starlight/components/MobileMenuToggle';
3-
3+
import type { Props } from '@astrojs/starlight/props';
44
import Sidebar from '@lorenzo_lewis/starlight-utils/components/Sidebar.astro';
55
const { t } = Astro.locals;
66
---
77

88
<div class="page sl-flex">
99
<header class="header"><slot name="header" /></header>
1010
<nav class="sidebar" aria-label={t('sidebarNav.accessibleLabel')}>
11-
<MobileMenuToggle />
11+
<MobileMenuToggle {...Astro.props} />
1212
<div
1313
id="starlight__sidebar"
14-
class={Astro.locals.starlightRoute.entry.slug === '' || Astro.locals.starlightRoute.locale === Astro.locals.starlightRoute.entry.slug
14+
class={Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug
1515
? 'sidebar-pane lp-hide'
1616
: 'sidebar-pane'}
1717
>
1818
<div class="sidebar-content sl-flex">
19-
<Sidebar />
19+
<Sidebar {...Astro.props} />
2020
</div>
2121
</div>
2222
</nav>

src/components/overrides/SiteTitle.astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// https://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro
44
// https://github.com/withastro/starlight/blob/main/packages/starlight/components/LanguageSelect.astro
55
6-
6+
import type { Props } from '@astrojs/starlight/props';
77
import Default from '@astrojs/starlight/components/SiteTitle.astro';
88
import { Icon } from '@astrojs/starlight/components';
99
10-
const curLocale = Astro.locals.starlightRoute.locale;
10+
const curLocale = Astro.props.locale;
1111
1212
type Link = {
1313
title: string;
@@ -40,7 +40,7 @@ const links: Link[] = [
4040
---
4141

4242
<>
43-
<Default ><slot /></Default>
43+
<Default {...Astro.props}><slot /></Default>
4444

4545
<starlight-select class="mobile">
4646
<label>

src/components/overrides/TableOfContents.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Props = BaseProps & {
88
};
99
};
1010
11-
const { toc } = Astro.locals.starlightRoute;
11+
const { toc } = Astro.props;
1212
const { t } = Astro.locals;
1313
---
1414

src/components/overrides/TableOfContents/TableOfContentsList.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface Props {
88
isMobile?: boolean;
99
}
1010
11-
const { toc, isMobile = false, depth = 0, collapseLevel = 1 } = Astro.locals.starlightRoute;
11+
const { toc, isMobile = false, depth = 0, collapseLevel = 1 } = Astro.props;
1212
---
1313

1414
<ul class:list={{ isMobile }}>

src/components/overrides/ThemeSelect.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
2+
import type { Props } from '@astrojs/starlight/props';
33
import { Icon } from '@astrojs/starlight/components';
44
---
55

src/components/plugins/Compatibility.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type PluginData, getSupportIcon, getSupportText } from './_helpers';
33
import data from './_tableContent.json';
44
import { createMarkdownProcessor } from '@astrojs/markdown-remark';
55
6-
const { plugin } = Astro.locals.starlightRoute;
6+
const { plugin } = Astro.props;
77
88
interface Props {
99
plugin: string;

src/components/plugins/CustomLinkCard.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props extends Omit<HTMLAttributes<'a'>, 'title'> {
1111
footer?: string;
1212
}
1313
14-
const { title, description, footer, ...attributes } = Astro.locals.starlightRoute;
14+
const { title, description, footer, ...attributes } = Astro.props;
1515
---
1616

1717
<div class="sl-link-card">

src/content/config.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { defineCollection } from 'astro:content';
2-
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema';
3-
import { docsLoader, i18nLoader } from "@astrojs/starlight/loaders";
2+
import { i18nSchema } from '@astrojs/starlight/schema';
3+
import { docsSchema } from 'src/schemas/docsSchema';
44

55
export const collections = {
6-
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
7-
i18n: defineCollection({ loader: i18nLoader(), schema: i18nSchema() })
6+
docs: defineCollection({
7+
schema: docsSchema,
8+
}),
9+
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
810
};

0 commit comments

Comments
 (0)