From 5c4675a9457148c226a11c738442b71e32c86825 Mon Sep 17 00:00:00 2001 From: tree Date: Thu, 25 Jan 2024 23:28:29 +0100 Subject: [PATCH] add place info at events --- package-lock.json | 12 ++++++++++++ package.json | 1 + src/components/EventItem.astro | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 6f87eff..e77aa43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "astro": "^3.4.3", "cfonts": "^3.2.0", "date-fns": "^2.30.0", + "marked": "^11.1.1", "tailwindcss": "^3.3.5" } }, @@ -2922,6 +2923,17 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/marked": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.1.1.tgz", + "integrity": "sha512-EgxRjgK9axsQuUa/oKMx5DEY8oXpKJfk61rT5iY3aRlgU6QJtUcxU5OAymdhCvWvhYcd9FKmO5eQoX8m9VGJXg==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/mdast-util-definitions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", diff --git a/package.json b/package.json index 5904444..7967893 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "astro": "^3.4.3", "cfonts": "^3.2.0", "date-fns": "^2.30.0", + "marked": "^11.1.1", "tailwindcss": "^3.3.5" } } diff --git a/src/components/EventItem.astro b/src/components/EventItem.astro index 89980b4..cf0623d 100644 --- a/src/components/EventItem.astro +++ b/src/components/EventItem.astro @@ -1,6 +1,7 @@ --- const { item } = Astro.props; -import { format, compareAsc, addDays } from 'date-fns' +import { format, compareAsc, addDays } from 'date-fns'; +import { marked } from 'marked'; function dateFormat (str) { if (str.match(/^\d{4}-\d{2}-\d{2}$/)) { @@ -98,6 +99,7 @@ const status = item.confirmed ? statuses.confirmed : (item.links?.rsvp ? statuse
Date: {dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}
+
Place: {item.place && || "TBD"}
Status: {status.title}
Lead: {item.lead || 'n/a'}