From 99421ebfa405e05336331b89e1828f367de82f7e Mon Sep 17 00:00:00 2001 From: KazooTTT Date: Sat, 23 Nov 2024 21:42:50 +0800 Subject: [PATCH] feat: all page add pageview --- src/components/layout/Footer.astro | 56 +++++++++++++++++++----------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/src/components/layout/Footer.astro b/src/components/layout/Footer.astro index 4576cf1..927178b 100644 --- a/src/components/layout/Footer.astro +++ b/src/components/layout/Footer.astro @@ -1,5 +1,10 @@ --- import { Icon } from 'astro-icon/components' +import PageViews from '../PageViews' + +const pathname = new URL(Astro.request.url).pathname +const isBlogPost = pathname.startsWith('/blog/') && pathname !== '/blog' +const slug = pathname === '/' ? 'home' : pathname.replace(/^\/|\/$/g, '') ---