11---
22import BaseLayout from " ./BaseLayout.astro" ;
3- import { formatDate , slugify } from " ../lib/utils" ;
3+ import { formatDate , slugify , withBase } from " ../lib/utils" ;
44
55interface Props {
66 title: string ;
@@ -27,7 +27,7 @@ const { title, publishDate, updatedDate, author, description, tags, slug } = Ast
2727 </div >
2828 { isDev && slug && (
2929 <a
30- href = { ` /keystatic/collection/posts/item/${slug } ` }
30+ href = { withBase ( ` /keystatic/collection/posts/item/${slug } ` ) }
3131 class = " edit-btn-always mt-2 flex-shrink-0 rounded-lg bg-zinc-100 p-2.5 text-zinc-400 hover:bg-amber-100 hover:text-amber-700 dark:bg-zinc-800 dark:text-zinc-600 dark:hover:bg-amber-900/30 dark:hover:text-amber-400"
3232 title = " Edit in Keystatic"
3333 >
@@ -39,7 +39,7 @@ const { title, publishDate, updatedDate, author, description, tags, slug } = Ast
3939 </div >
4040
4141 <div class =" mt-4 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-zinc-500 dark:text-zinc-400" >
42- <a href ={ ` /authors/${slugify (author )} ` } class =" font-medium text-zinc-800 hover:text-[#306998] dark:text-zinc-200 dark:hover:text-[#ffd43b] transition-colors" >{ author } </a >
42+ <a href ={ withBase ( ` /authors/${slugify (author )} ` ) } class =" font-medium text-zinc-800 hover:text-[#306998] dark:text-zinc-200 dark:hover:text-[#ffd43b] transition-colors" >{ author } </a >
4343 <span class =" text-zinc-300 dark:text-zinc-600" >/</span >
4444 <time datetime ={ publishDate } >{ formatDate (publishDate )} </time >
4545 { updatedDate && (
@@ -54,7 +54,7 @@ const { title, publishDate, updatedDate, author, description, tags, slug } = Ast
5454 <div class = " mt-5 flex flex-wrap gap-1.5" >
5555 { tags .map ((tag ) => (
5656 <a
57- href = { ` /tags/${tag } ` }
57+ href = { withBase ( ` /tags/${tag } ` ) }
5858 class = " tag-pill rounded-md bg-zinc-100 px-2.5 py-1 text-xs font-medium text-zinc-600 dark:bg-zinc-700/60 dark:text-zinc-300"
5959 >
6060 { tag }
@@ -73,15 +73,15 @@ const { title, publishDate, updatedDate, author, description, tags, slug } = Ast
7373 <footer class =" not-prose mt-14 border-t border-zinc-200 pt-8 dark:border-zinc-700" >
7474 <div class =" flex items-center justify-between" >
7575 <a
76- href =" /blog"
76+ href ={ withBase ( " /blog" ) }
7777 class =" group inline-flex items-center gap-2 text-sm font-medium text-[#306998] transition-colors hover:text-[#254f73] dark:text-[#ffd43b] dark:hover:text-[#f0c419]"
7878 >
7979 <span class =" transition-transform group-hover:-translate-x-0.5" >← </span >
8080 Back to all posts
8181 </a >
8282 { isDev && slug && (
8383 <a
84- href = { ` /keystatic/collection/posts/item/${slug } ` }
84+ href = { withBase ( ` /keystatic/collection/posts/item/${slug } ` ) }
8585 class = " inline-flex items-center gap-1.5 rounded-lg bg-zinc-100 px-3 py-1.5 text-xs font-medium text-zinc-500 transition-colors hover:bg-amber-100 hover:text-amber-700 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-amber-900/30 dark:hover:text-amber-400"
8686 >
8787 <svg class = " h-3 w-3" fill = " none" viewBox = " 0 0 24 24" stroke = " currentColor" stroke-width = " 2" >
0 commit comments