-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7024536
commit cac8511
Showing
10 changed files
with
83 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,70 @@ | ||
--- | ||
import { CollectionEntry } from 'astro:content'; | ||
import Markdown from '@astrojs/markdown-component'; | ||
// import truncateMarkdown from 'markdown-truncate'; | ||
export interface Props { | ||
title: string; | ||
event: string; | ||
body: string; | ||
pres_url: string; | ||
pres_source: string; | ||
start_date: Date; | ||
venue: string; | ||
} | ||
const { title, event, body, pres_url, start_date, venue} = Astro.props; | ||
// const { Content } = await event.render(); | ||
const { title, event, body, pres_url, pres_source, start_date, venue } = Astro.props; | ||
var formatted_date = start_date.toLocaleDateString('en-GB', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); | ||
var formatted_date = start_date.toLocaleDateString('en-GB', { | ||
weekday: 'long', | ||
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
}); | ||
var currentDate = new Date(); | ||
var eventDate = new Date(start_date); | ||
var eventFormat = ''; | ||
{ | ||
currentDate < eventDate ? (eventFormat = 'opacity-100') : (eventFormat = 'opacity-45'); | ||
} | ||
// Truncate text | ||
// TODO: Better way? | ||
// TODO: Make to helper or plugin | ||
// var truncatedText = body.split("</p>"); | ||
//${image ? 'md:grid-cols-2' : '' | ||
--- | ||
<article class="max-w-md mx-auto md:max-w-none grid gap-6 md:gap-8 md:grid-cols-2"> | ||
|
||
<article class=`max-w-md mx-auto md:max-w-none grid gap-6 md:gap-8 md:grid-cols-2 ${eventFormat} | ||
`> | ||
<div class="relative h-0 pb-[56.25%] md:pb-[75%] lg:pb-[56.25%] overflow-hidden"> | ||
<h3 class="text-xl"> | ||
{formatted_date}, {venue} | ||
</h3> | ||
<a class="hover:text-primary dark:hover:text-blue-700 transition ease-in duration-200" href={pres_url}> | ||
{pres_url} | ||
</a> | ||
</div> | ||
|
||
<div class="mt-2"> | ||
<header> | ||
<h3 class="text-xl"> | ||
{formatted_date} | ||
</h3> | ||
<h3 class="text-xl"> | ||
{venue} | ||
</h3> | ||
{ | ||
pres_source ? ( | ||
<a class="hover:text-primary dark:hover:text-blue-700 transition ease-in duration-200" href={pres_source}> | ||
{title} | ||
</a> | ||
) : ( | ||
'' | ||
) | ||
} | ||
</div> | ||
|
||
<div class="mt-2"> | ||
<header> | ||
<h2 class="text-xl sm:text-2xl leading-tight mb-2 font-subheading font-semibold dark:text-slate-300"> | ||
{ | ||
pres_url ? ( | ||
<a class="hover:text-primary dark:hover:text-blue-700 transition ease-in duration-200" href={pres_url}> | ||
{title} | ||
</a> | ||
) : ( | ||
title | ||
) | ||
} @ {event} | ||
{event} | ||
</h2> | ||
</header> | ||
<!-- TODO: Seems kind of ridiculous --> | ||
<Markdown class="m-2" />{body} | ||
</header> | ||
<!-- TODO: Seems kind of ridiculous --> | ||
<Markdown class="m-2" />{body} | ||
<div class="mt-2"> | ||
<a class="hover:text-primary dark:hover:text-blue-700 transition ease-in duration-200" href={pres_url}> | ||
{pres_url} | ||
</a> | ||
</div> | ||
</article> | ||
</div> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters