From c05eb632ddedaa03c9d2deae1260084d77991846 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Tue, 20 Feb 2024 01:41:07 -0800 Subject: [PATCH] more progress and its working --- .../src/components/Metadata.astro | 18 +++++++++++--- .../src/overrides/SiteTitle.astro | 24 ++++++++++--------- .../starlight-ghostcms/src/routes/index.astro | 14 +++++++++++ .../starlight-ghostcms/src/schemas/config.ts | 4 ++++ .../src/utils/api/api-functions.ts | 10 ++++++-- .../src/pages/testslug/index.astro | 4 ---- 6 files changed, 54 insertions(+), 20 deletions(-) delete mode 100644 starlight-playground/src/pages/testslug/index.astro diff --git a/packages/starlight-ghostcms/src/components/Metadata.astro b/packages/starlight-ghostcms/src/components/Metadata.astro index 792ca8f4..f3de8cba 100644 --- a/packages/starlight-ghostcms/src/components/Metadata.astro +++ b/packages/starlight-ghostcms/src/components/Metadata.astro @@ -1,5 +1,4 @@ --- - import type { Post } from '../schemas/posts' import Author from './Author.astro' @@ -10,12 +9,25 @@ interface Props { const { entry } = Astro.props const { authors, published_at, created_at } = entry +const dateC = new Date(published_at?published_at:created_at) +const dateISO = dateC.toISOString() +const dateLocal = dateC + .toLocaleDateString( + "en-US", { + year: 'numeric', + month: 'long', + day: 'numeric', + hour: '2-digit', + minute: '2-digit' + } + ) + const hasAuthors = authors !== undefined ---
-