fix: Check errors

Signed-off-by: Florian Bouillon <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2023-10-04 17:23:54 +02:00
parent 9a70042506
commit 4a944f9e61
6 changed files with 35 additions and 25 deletions

View File

@ -2,7 +2,7 @@
interface Props {
items: Array<{
text: string
href?: string
href?: string | undefined
}>
}
---

View File

@ -11,7 +11,8 @@ const projectsCollection = defineCollection({
link: z.object({
href: z.string(),
rel: z.string().optional(),
text: z.string().optional()
text: z.string().optional(),
target: z.string().optional()
}).optional(),
disabled: z.string().optional(),
created: z.date().optional(),

View File

@ -7,14 +7,14 @@ import Breadcrumb from 'components/global/Breadcrumb.astro'
export interface Props extends BaseProps {
link?: {
href: string
rel?: string
text?: string
target?: string
}
disabled?: string
rel?: string | undefined
text?: string | undefined
target?: string | undefined
} | undefined
disabled?: string | undefined
breadcrumb: Array<{
text: string
href?: string
href?: string | undefined
}>
}
---

View File

@ -5,23 +5,23 @@ import IconPNG from '../assets/layouts/Base/favicon.png'
import '@fontsource-variable/lexend'
export interface Props {
siteName?: string
title?: string
description?: string
canonical?: string
image?: Array<typeof IconPNG>
siteName?: string | undefined
title?: string | undefined
description?: string | undefined
canonical?: string | undefined
image?: Array<typeof IconPNG> | undefined
twitter?: {
title?: string
card?: "summary" | "summary_large_image" | "app" | "player"
site?: string
creator?: string
}
title?: string | undefined
card?: "summary" | "summary_large_image" | "app" | "player" | undefined
site?: string | undefined
creator?: string | undefined
} | undefined
og?: {
title?: string
type?: string
description?: string
url?: string
}
title?: string | undefined
type?: string | undefined
description?: string | undefined
url?: string | undefined
} | undefined
}
const props = Astro.props

View File

@ -1,6 +1,5 @@
---
import { getCollection } from 'astro:content'
import { Image } from 'astro:assets'
import Layout from 'layouts/Layout.astro'
import Picture from 'components/Picture.astro'

View File

@ -15,7 +15,17 @@ export async function getStaticPaths() {
const { entry } = Astro.props as Awaited<ReturnType<typeof getStaticPaths>>[0]['props'];
const { Content } = await entry.render();
---
<Article title={entry.data.title} image={[entry.data.image]} description={entry.data.description} link={entry.data.link} breadcrumb={[{text: 'Accueil', href: '/'}, {text: 'Projets', href: '/projets'}, {text: entry.data.title}]}>
<Article
title={entry.data.title}
image={entry.data.image ? [entry.data.image] : undefined}
description={entry.data.description}
link={entry.data.link}
breadcrumb={[
{text: 'Accueil', href: '/'},
{text: 'Projets', href: '/projets'},
{text: entry.data.title}
]}
>
<h1>{entry.data.title}</h1>
<p class="flex justify-end font-lights my-0">
{entry.data.created && (