From ed2c9768a0471d11a0b87a5514dcbf387ebbf8f7 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 25 Jan 2024 20:09:56 -0500 Subject: Markdown cb style; Fixed chrome-only issue; Format date on blog --- astro.config.mjs | 16 +++++++++++++++- src/layouts/BlogPost.astro | 3 ++- src/layouts/Default.astro | 8 +++++++- src/pages/blog/[...slug].astro | 3 ++- src/util.ts | 8 ++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/util.ts diff --git a/astro.config.mjs b/astro.config.mjs index d2dbc06..e7e5cf0 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,5 +12,19 @@ export default defineConfig({ adapter: vercel(), image: { service: passthroughImageService(), - } + }, + markdown: { + shikiConfig: { + // Choose from Shiki's built-in themes (or add your own) + // https://github.com/shikijs/shiki/blob/main/docs/themes.md + theme: 'dracula', + // Alternatively, provide multiple themes + // https://shikiji.netlify.app/guide/dual-themes#light-dark-dual-themes + // Enable word wrap to prevent horizontal scrolling + wrap: true, + // Add custom transformers: https://shikiji.netlify.app/guide/transformers + // Find common transformers: https://shikiji.netlify.app/packages/transformers + transformers: [], + }, + }, }); diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index 60baee6..15b3cfd 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -1,12 +1,13 @@ --- import Layout from './Default.astro'; -const { title, description } = Astro.props; +const { title, description, date } = Astro.props; ---

{title}

{description}

+ {date}
diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index b2e383b..d3b7548 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -38,7 +38,7 @@ import Navbar from '../components/Navbar.vue'; -
+