fix: hardcoded lieu url
parent
d3c9c8175b
commit
b63878bab1
|
@ -30,6 +30,7 @@ const { evenement } = Astro.props;
|
|||
|
||||
<style>
|
||||
.evenement {
|
||||
margin: 1em 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
column-gap: 1em;
|
||||
|
@ -43,7 +44,7 @@ const { evenement } = Astro.props;
|
|||
font-size:20px;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
text-decoration: underline orange;
|
||||
color: rgb(17,17,17);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,14 +13,16 @@ export interface ContentFulEvenement {
|
|||
slug: EntryFieldTypes.Text,
|
||||
description: EntryFieldTypes.RichText,
|
||||
date: EntryFieldTypes.Date,
|
||||
lieu: EntryFieldTypes.Location,
|
||||
lieu: EntryFieldTypes.Text,
|
||||
lieuUrl: EntryFieldTypes.Text,
|
||||
position: EntryFieldTypes.Location,
|
||||
affiche: EntryFieldTypes.AssetLink,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const evenementFromContentfull = ({ fields: { nom, slug, description, date, affiche, lieu } }: Entry<ContentFulEvenement>) => ({
|
||||
nom, slug, description, date, affiche, lieu
|
||||
export const evenementFromContentfull = ({ fields: { nom, slug, description, date, affiche, lieu, lieuUrl, position } }: Entry<ContentFulEvenement>) => ({
|
||||
nom, slug, description, date, affiche, lieu, lieuUrl, position
|
||||
})
|
||||
|
||||
export const sortByDate = (evenements: Entry<ContentFulEvenement>[]): Entry<ContentFulEvenement>[] => {
|
||||
|
|
|
@ -14,20 +14,23 @@ export async function getStaticPaths() {
|
|||
description: evenement.description ? documentToHtmlString(evenement.description as Document) : "",
|
||||
date: evenement.date ? new Date(evenement.date as string).toLocaleDateString() : "",
|
||||
lieu: evenement.lieu,
|
||||
lieuUrl: evenement.lieuUrl,
|
||||
affiche: evenement.affiche
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
const { nom, description, date, lieu, affiche } = Astro.props;
|
||||
const { nom, description, date, lieu, lieuUrl, affiche } = Astro.props;
|
||||
const Wrapper = lieuUrl ? 'a' : 'div'
|
||||
console.log({ nom, description, date, lieu, lieuUrl, affiche })
|
||||
---
|
||||
<Layout>
|
||||
<h1>{nom}</h1>
|
||||
<div class="content">
|
||||
<img alt=`Affiche de ${nom}` src={affiche?.fields.file.url} />
|
||||
{affiche && <img alt=`Affiche de ${nom}` src={affiche?.fields.file.url} />}
|
||||
<Card title={date}>
|
||||
<div>
|
||||
à <a target="_blank" href="https://cartessurtable.wixsite.com/cartes-sur-table">{lieu}</a>
|
||||
à <Wrapper target="_blank" href={lieuUrl}>{lieu}</Wrapper>
|
||||
</div>
|
||||
|
||||
<article set:html={description} />
|
||||
|
@ -37,7 +40,7 @@ const { nom, description, date, lieu, affiche } = Astro.props;
|
|||
|
||||
<style is:global>
|
||||
main {
|
||||
margin: auto;
|
||||
margin: 0 auto;
|
||||
padding: 1.5rem;
|
||||
max-width: none;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue