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