Skip to content

Upgraded Astro and Starlight. #922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions packages/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export default defineConfig({
description: 'Your product answer engine. Unlimited full-text search, embeddings generations and more. Help your users find the right answers, faster.',
favicon: '/favicon.png',
head: head,
social: {
github: 'https://github.com/oramasearch/orama',
slack: 'https://orama.to/slack',
twitter: 'https://x.com/oramasearch',
},
social: [
{ icon: 'github', label: 'GitHub', href: 'https://github.com/oramasearch/orama' },
{ icon: 'slack', label: 'Slack', href: 'https://orama.to/slack' },
{ icon: 'x.com', label: 'X', href: 'https://x.com/oramasearch' },
],
customCss: ['./src/tailwind.css', './src/styles/custom.css'],
logo: {
replacesTitle: true,
Expand All @@ -49,7 +49,6 @@ export default defineConfig({
Header: './src/components/Header.astro',
Footer: './src/components/Footer.astro',
Search: './src/components/Search.astro',
Hero: "./src/components/Hero.astro",
Head: './src/components/Head.astro',
TableOfContents: './src/components/TableOfContents.astro',
},
Expand Down
26 changes: 13 additions & 13 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
"dotenv": "^16.4.5",
"globby": "^14.0.2",
"html-to-text": "^9.0.5",
"sharp": "^0.33.4",
"tsx": "^4.16.2",
"typescript": "^5.4.5"
"sharp": "^0.34.1",
"tsx": "^4.19.3",
"typescript": "^5.8.3"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^3.6.0",
"@astrojs/starlight": "^0.26.3",
"@astrojs/starlight-tailwind": "^2.0.3",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/starlight": "^0.33.2",
"@astrojs/starlight-tailwind": "^3.0.1",
"@astrojs/tailwind": "^6.0.2",
"@jop-software/astro-cookieconsent": "^3.0.0",
"@orama/react-components": "^0.0.28",
"@oramacloud/client": "^1.3.16",
"astro": "^4.16.18",
"astro-og-canvas": "^0.5.3",
"canvaskit-wasm": "^0.39.1",
"astro": "^5.7.1",
"astro-og-canvas": "^0.7.0",
"canvaskit-wasm": "^0.40.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"starlight-image-zoom": "^0.8.0",
"starlight-showcases": "^0.2.0",
"starlight-image-zoom": "^0.12.0",
"starlight-showcases": "^0.3.0",
"tailwindcss": "^3.4.4",
"vanilla-cookieconsent": "^3.0.1"
}
}
}
40 changes: 7 additions & 33 deletions packages/docs/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
---
import type { Props } from '@astrojs/starlight/props';

import EditLink from '@astrojs/starlight/components/EditLink.astro';
import LastUpdated from '@astrojs/starlight/components/LastUpdated.astro';
import Pagination from '@astrojs/starlight/components/Pagination.astro';
import Default from '@astrojs/starlight/components/Footer.astro';
---

<footer class="sl-flex">
<div class="meta sl-flex">
<EditLink {...Astro.props} />
<LastUpdated {...Astro.props} />
</div>
<Pagination {...Astro.props} />
<div class="github">
<span>Show your support! Star us on GitHub ⭐️</span>
<a class="github-button" href="https://github.com/oramasearch/orama" data-color-scheme="no-preference: light; light: light; dark: light;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star oramasearch/orama on GitHub">Star</a>
</div>
</footer>
<Default />
<div class="github">
<span>Show your support! Star us on GitHub ⭐️</span>
<a class="github-button" href="https://github.com/oramasearch/orama" data-color-scheme="no-preference: light; light: light; dark: light;" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star oramasearch/orama on GitHub">Star</a>
</div>

<style>
footer {
flex-direction: column;
gap: 1.5rem;
}
.meta {
gap: 0.75rem 3rem;
justify-content: space-between;
flex-wrap: wrap;
margin-top: 3rem;
font-size: var(--sl-text-sm);
color: var(--sl-color-gray-3);
}
.meta > :global(p:only-child) {
margin-inline-start: auto;
}

.github {
align-items: center;
justify-content: center;
Expand All @@ -49,4 +23,4 @@ import Pagination from '@astrojs/starlight/components/Pagination.astro';
font-size: var(--sl-text-sm);
cursor: default;
}
</style>
</style>
5 changes: 2 additions & 3 deletions packages/docs/src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
import type { Props } from '@astrojs/starlight/props'
import Default from '@astrojs/starlight/components/Head.astro'

const ogImageUrl = new URL(`/og/${Astro.props.id.replace(/\.\w+$/, '.png')}`, Astro.site)
const ogImageUrl = new URL(`/og/${Astro.locals.starlightRoute.id.replace(/\.\w+$/, '.png')}`, Astro.site)
---

<Default {...Astro.props}><slot /></Default>
Expand All @@ -13,4 +12,4 @@ const ogImageUrl = new URL(`/og/${Astro.props.id.replace(/\.\w+$/, '.png')}`, As
<script is:inline>
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys getNextSurveyStep onSessionId".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init('phc_FckUxnRec0gteNF9WiHB9tFCejr7ISAXALOoYqaaVO3', { api_host: 'https://eu.i.posthog.com', person_profiles: 'identified_only' });
</script>
</script>
140 changes: 0 additions & 140 deletions packages/docs/src/components/Hero.astro

This file was deleted.

6 changes: 2 additions & 4 deletions packages/docs/src/components/Sidebar.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
import type { Props } from '@astrojs/starlight/props'

import MobileMenuFooter from "@astrojs/starlight/components/MobileMenuFooter.astro";
import SidebarSublist from "./SidebarSublist.astro";

const sidebar = (
Astro.props.sidebar.filter((k) =>
Astro.props.slug.startsWith('open-source') ? k.label === 'open-source' : k.label === 'cloud'
Astro.locals.starlightRoute.sidebar.filter((k) =>
Astro.locals.starlightRoute.slug.startsWith('open-source') ? k.label === 'open-source' : k.label === 'cloud'
)[0] as any
).entries;

Expand Down
5 changes: 2 additions & 3 deletions packages/docs/src/components/TableOfContents.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
import type { Props } from '@astrojs/starlight/props';
import TableOfContentsList from './TableOfContents/TableOfContentsList.astro';
import { Icon } from '@astrojs/starlight/components';

const { labels, toc } = Astro.props;

const showMiniBanner = Astro.props.slug.startsWith("open-source");
const showMiniBanner = Astro.locals.starlightRoute.id.startsWith("open-source");

---

Expand Down Expand Up @@ -48,4 +47,4 @@ const showMiniBanner = Astro.props.slug.startsWith("open-source");
margin: 16px 0;
opacity: 0.1;
}
</style>
</style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineCollection } from 'astro:content'
import { docsLoader } from '@astrojs/starlight/loaders'
import { docsSchema } from '@astrojs/starlight/schema'

export const collections = {
docs: defineCollection({ schema: docsSchema() })
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() })
}
Loading