From cac85112d93f84c6565a9664d76fa8dc79ac9f77 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Sat, 23 Mar 2024 14:11:29 +0100 Subject: [PATCH] Change event layout --- src/components/Event.astro | 78 +++++++++++-------- src/content/events/2020-02-27-megacomm.md | 1 + .../events/2020-12-04-write-the-docs-au.md | 1 + .../2020-12-09-automate-api-perfection.md | 1 + src/content/events/2021-02-20-arizona-stc.md | 1 + .../events/2021-03-09-last-clubhouse.md | 1 + src/content/events/2022-11-03-heapcon-2022.md | 4 +- src/content/events/2023-11-13-slush-2023.md | 2 +- .../events/2023-11-13-web-summit-2023.md | 2 +- src/pages/events/[...page].astro | 61 +++++++-------- 10 files changed, 83 insertions(+), 69 deletions(-) diff --git a/src/components/Event.astro b/src/components/Event.astro index 4090a387..53ec4075 100644 --- a/src/components/Event.astro +++ b/src/components/Event.astro @@ -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("

"); - -//${image ? 'md:grid-cols-2' : '' - --- -
+ + \ No newline at end of file + +
diff --git a/src/content/events/2020-02-27-megacomm.md b/src/content/events/2020-02-27-megacomm.md index 86e5ab99..1f79c324 100755 --- a/src/content/events/2020-02-27-megacomm.md +++ b/src/content/events/2020-02-27-megacomm.md @@ -4,6 +4,7 @@ title: Automating and testing documentation event: MEGAComm layout: "../../layouts/Event.astro" venue: 'Cinema City, Jerusalem' +pres_source: 'https://megacomm.org/' pres_url: 'https://megacomm.org/' start_date: 2020-02-27T12:20:00.000Z end_date: 2020-02-27T12:20:00.000Z diff --git a/src/content/events/2020-12-04-write-the-docs-au.md b/src/content/events/2020-12-04-write-the-docs-au.md index 4cce84af..0944a736 100644 --- a/src/content/events/2020-12-04-write-the-docs-au.md +++ b/src/content/events/2020-12-04-write-the-docs-au.md @@ -4,6 +4,7 @@ title: An introduction to developer experience, and the role of a documentarian event: Write the Docs layout: "../../layouts/Event.astro" venue: 'online' +pres_source: 'https://writethedocs.org/' pres_url: 'https://writethedocs.org/' start_date: 2020-12-03T12:20:00.000Z end_date: 2020-12-04T12:20:00.000Z diff --git a/src/content/events/2020-12-09-automate-api-perfection.md b/src/content/events/2020-12-09-automate-api-perfection.md index 91572491..582b1c21 100644 --- a/src/content/events/2020-12-09-automate-api-perfection.md +++ b/src/content/events/2020-12-09-automate-api-perfection.md @@ -4,6 +4,7 @@ title: Automate your APIs to perfection event: APIDays layout: "../../layouts/Event.astro" venue: 'online' +pres_source: 'https://writethedocs.org/' pres_url: 'https://writethedocs.org/' start_date: 2020-12-07T12:20:00.000Z end_date: 2020-12-09T12:20:00.000Z diff --git a/src/content/events/2021-02-20-arizona-stc.md b/src/content/events/2021-02-20-arizona-stc.md index ab28d600..997fdb04 100644 --- a/src/content/events/2021-02-20-arizona-stc.md +++ b/src/content/events/2021-02-20-arizona-stc.md @@ -4,6 +4,7 @@ title: An Introduction to docs-as-code event: Arizona STC layout: "../../layouts/Event.astro" venue: Online +pres_source: https://www.meetup.com/Metro-Phoenix-Technical-Communicators/events/276301189/ pres_url: https://www.meetup.com/Metro-Phoenix-Technical-Communicators/events/276301189/ start_date: 2021-02-20T12:20:00.000Z end_date: 2021-02-20T12:20:00.000Z diff --git a/src/content/events/2021-03-09-last-clubhouse.md b/src/content/events/2021-03-09-last-clubhouse.md index 05963d48..cad9eb6e 100644 --- a/src/content/events/2021-03-09-last-clubhouse.md +++ b/src/content/events/2021-03-09-last-clubhouse.md @@ -4,6 +4,7 @@ title: An Introduction to Developer Experience event: LAST Clubhouse layout: "../../layouts/Event.astro" venue: Online +pres_source: https://clubhouse.lastconference.com/offers/jt4DeFvC pres_url: https://clubhouse.lastconference.com/offers/jt4DeFvC start_date: 2021-03-09T12:20:00.000Z end_date: 2021-03-09T12:20:00.000Z diff --git a/src/content/events/2022-11-03-heapcon-2022.md b/src/content/events/2022-11-03-heapcon-2022.md index ca529737..aefb1aea 100644 --- a/src/content/events/2022-11-03-heapcon-2022.md +++ b/src/content/events/2022-11-03-heapcon-2022.md @@ -6,8 +6,8 @@ event: heapcon start_date: 2022-11-03T12:20:00.000Z end_date: 2022-11-04T00:00:00.000Z venue: Belgrade, Serbia -pres_source: https://heapcon.io/2022/ -pres_url: https://heapcon.io/2022/a-short-guide-to-creating-interactive-fiction/ +pres_url: https://heapcon.io/2022/ +pres_source: https://heapcon.io/2022/a-short-guide-to-creating-interactive-fiction/ --- Interactive fiction (IF) occupies a curious middle ground between technical writing, programming, and creative writing. This presentation takes a look at the history of IF games, the tools used to create them across the decades, and how you can use your programming skills to tell stories. \ No newline at end of file diff --git a/src/content/events/2023-11-13-slush-2023.md b/src/content/events/2023-11-13-slush-2023.md index 776c5c33..8ddc8c02 100644 --- a/src/content/events/2023-11-13-slush-2023.md +++ b/src/content/events/2023-11-13-slush-2023.md @@ -6,7 +6,7 @@ event: Slush start_date: 2023-11-13T12:20:00.000Z end_date: 2023-11-16T12:20:00.000Z venue: 'Helsinki, Finland' -pres_source: https://slush.org/speakers/ +pres_url: https://slush.org/speakers/ --- Chris is back at Europe's cosy winter for Startups and keen to meet interesting products, projects and people. diff --git a/src/content/events/2023-11-13-web-summit-2023.md b/src/content/events/2023-11-13-web-summit-2023.md index 263051f7..9def98ee 100644 --- a/src/content/events/2023-11-13-web-summit-2023.md +++ b/src/content/events/2023-11-13-web-summit-2023.md @@ -6,7 +6,7 @@ event: Web Summit start_date: 2023-11-13T12:20:00.000Z end_date: 2023-11-16T12:20:00.000Z venue: 'MEO Arena, Lisbon' -pres_source: https://websummit.com +pres_url: https://websummit.com --- Chris is back at Europe's pre-eminent event for Startups and keen to meet interesting products, projects and people. diff --git a/src/pages/events/[...page].astro b/src/pages/events/[...page].astro index 3629266d..1e5041c1 100644 --- a/src/pages/events/[...page].astro +++ b/src/pages/events/[...page].astro @@ -1,15 +1,13 @@ --- -import Layout from "~/layouts/PageLayoutNoBG.astro"; -import { Pagination } from "accessible-astro-components"; +import Layout from '~/layouts/PageLayoutNoBG.astro'; +import { Pagination } from 'accessible-astro-components'; import Headline from '~/components/blog/Headline.astro'; -import Event from "~/components/Event.astro"; +import Event from '~/components/Event.astro'; import { getCollection } from 'astro:content'; export async function getStaticPaths({ paginate }) { let allEvents = await getCollection('events'); -allEvents = allEvents.sort( - (a, b) => new Date(b.data.start_date).valueOf() - new Date(a.data.start_date).valueOf() - ); + allEvents = allEvents.sort((a, b) => new Date(b.data.start_date).valueOf() - new Date(a.data.start_date).valueOf()); return paginate(allEvents, { // TODO: Parameterize pageSize: 25, @@ -18,8 +16,8 @@ allEvents = allEvents.sort( const { page } = Astro.props; const meta = { - title: "Events", - description: "I have spoken at and reported on hundreds of events around the world. This page still needs some polish 😁.", + title: 'Events', + description: 'I have spoken at and reported on hundreds of events around the world.', // canonical: post.canonical || url, // image: await findImage(post.image), // noindex: BLOG?.post?.noindex, @@ -29,39 +27,34 @@ const meta = {
- - + {meta.title} -
    - { +
      + { page.data.map((event) => ( -
    • - - + -
    • - )) - } -
    - - -
-
\ No newline at end of file + + )) + } + + + + +