Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker committed Dec 12, 2024
1 parent 2a2fb74 commit c04a242
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import cloudflare from "@astrojs/cloudflare";
import sitemap from "@astrojs/sitemap";
import react from "@astrojs/react";
import markdoc from "@astrojs/markdoc";
import keystatic from "@keystatic/astro";
import autoprefixer from "autoprefixer";
import postcssUtopia from "postcss-utopia";
import postcssMediaMinMax from "postcss-media-minmax";
Expand All @@ -18,7 +17,12 @@ export default defineConfig({
imageService: "compile",
}),
site: "https://namesake.fyi",
integrations: [sitemap(), react(), markdoc(), keystatic()],
integrations: [
sitemap(),
react(),
markdoc(),
// keystatic() Re-enable when Keystatic supports Astro v5
],
prefetch: true,
vite: {
ssr: {
Expand Down
6 changes: 4 additions & 2 deletions src/pages/[id].astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { getCollection, type CollectionEntry, render } from "astro:content";
import ProseLayout from "~/layouts/ProseLayout.astro";
export interface Props {
Expand All @@ -12,11 +11,14 @@ export async function getStaticPaths() {
return pages.map((page) => ({
params: { id: page.id },
props: page,
props: { page },
}));
}
const { page } = Astro.props;
if (!page) return Astro.redirect("/404");
const { data } = page;
const { Content } = await render(page);
---
Expand Down
5 changes: 3 additions & 2 deletions src/pages/blog/[id].astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import { Image } from "astro:assets";
import ProseLayout from "~/layouts/ProseLayout.astro";
import {
getCollection,
getEntries,
Expand All @@ -18,12 +17,14 @@ export async function getStaticPaths() {
return posts.map((post) => ({
params: { id: post.id },
props: post,
props: { post },
}));
}
const { post } = Astro.props;
if (!post) return Astro.redirect("/404");
const { data } = post;
const { Content } = await render(post);
Expand Down

0 comments on commit c04a242

Please sign in to comment.