Skip to content
Open
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
20 changes: 20 additions & 0 deletions 010-Getting-started/030-Framework-starter-guides/010-astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,26 @@ export default defineConfig({

Adding ssr for deployment adds for better functionality and allows for growth overtime as your application grows.

Because SSR pages can’t use getStaticPaths(), they can’t receive props. Update the `src/pages/posts/[slug].astro` as follows:
```astro title="src/pages/index.astro" {1,13}
---
import MainLayout from "../../layouts/main.astro";

import { XataClient } from "../../xata";

const { slug } = Astro.params;

const xata = new XataClient({
apiKey: import.meta.env.XATA_API_KEY,
branch: import.meta.env.XATA_BRANCH,
});
const post = await xata.db.Posts.filter({ slug: slug }).getFirstOrThrow();
---
...

```


Adding search is as simple as updating the landing page as follows:

```astro title="src/pages/index.astro" {11,13-18,22-31}
Expand Down