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 { interface Props {
items: Array<{ items: Array<{
text: string text: string
href?: string href?: string | undefined
}> }>
} }
--- ---

View File

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

View File

@ -7,14 +7,14 @@ import Breadcrumb from 'components/global/Breadcrumb.astro'
export interface Props extends BaseProps { export interface Props extends BaseProps {
link?: { link?: {
href: string href: string
rel?: string rel?: string | undefined
text?: string text?: string | undefined
target?: string target?: string | undefined
} } | undefined
disabled?: string disabled?: string | undefined
breadcrumb: Array<{ breadcrumb: Array<{
text: string 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' import '@fontsource-variable/lexend'
export interface Props { export interface Props {
siteName?: string siteName?: string | undefined
title?: string title?: string | undefined
description?: string description?: string | undefined
canonical?: string canonical?: string | undefined
image?: Array<typeof IconPNG> image?: Array<typeof IconPNG> | undefined
twitter?: { twitter?: {
title?: string title?: string | undefined
card?: "summary" | "summary_large_image" | "app" | "player" card?: "summary" | "summary_large_image" | "app" | "player" | undefined
site?: string site?: string | undefined
creator?: string creator?: string | undefined
} } | undefined
og?: { og?: {
title?: string title?: string | undefined
type?: string type?: string | undefined
description?: string description?: string | undefined
url?: string url?: string | undefined
} } | undefined
} }
const props = Astro.props const props = Astro.props

View File

@ -1,6 +1,5 @@
--- ---
import { getCollection } from 'astro:content' import { getCollection } from 'astro:content'
import { Image } from 'astro:assets'
import Layout from 'layouts/Layout.astro' import Layout from 'layouts/Layout.astro'
import Picture from 'components/Picture.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 { entry } = Astro.props as Awaited<ReturnType<typeof getStaticPaths>>[0]['props'];
const { Content } = await entry.render(); 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> <h1>{entry.data.title}</h1>
<p class="flex justify-end font-lights my-0"> <p class="flex justify-end font-lights my-0">
{entry.data.created && ( {entry.data.created && (