From d7df071adb6de26fcc2b29a5809ff1e7914b0a75 Mon Sep 17 00:00:00 2001 From: Karol Date: Wed, 6 Sep 2023 09:44:27 +0200 Subject: [PATCH 1/4] Fix updated date --- astro.config.mjs | 31 +++++++++++-------- .../RightSidebar/RightSidebar.astro | 2 +- .../RightSidebar/TableOfContents.tsx | 7 +---- src/config.ts | 2 ++ src/layouts/MainLayout.astro | 14 ++++++--- src/utils/filePath.mjs | 6 ++++ src/utils/modifiedTime.mjs | 9 ++++++ 7 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 src/utils/filePath.mjs create mode 100644 src/utils/modifiedTime.mjs diff --git a/astro.config.mjs b/astro.config.mjs index 691487d1..f06e6097 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -7,20 +7,25 @@ import compress from 'astro-compress' import { defineConfig } from 'astro/config' import sitemap from '@astrojs/sitemap' import tailwind from '@astrojs/tailwind' +import { modifiedTime } from './src/utils/modifiedTime.mjs' +import { filePath } from './src/utils/filePath.mjs' // https://astro.build/config export default defineConfig({ - integrations: [ - preact({ - include: ['**/preact/*'], - }), - react({ - include: ['**/react/*'], - }), - mdx(), - compress(), - sitemap(), - tailwind(), - ], - site: `https://bewebdev.tech/`, + integrations: [ + preact({ + include: ['**/preact/*'], + }), + react({ + include: ['**/react/*'], + }), + mdx(), + compress(), + sitemap(), + tailwind(), + ], + markdown: { + remarkPlugins: [modifiedTime, filePath], + }, + site: `https://bewebdev.tech/`, }) diff --git a/src/components/RightSidebar/RightSidebar.astro b/src/components/RightSidebar/RightSidebar.astro index b735c7f8..1f880ee5 100644 --- a/src/components/RightSidebar/RightSidebar.astro +++ b/src/components/RightSidebar/RightSidebar.astro @@ -12,7 +12,7 @@ const { headings, githubEditUrl } = Astro.props as Props ---