@@ -6,6 +6,7 @@ import { generateWebsiteJsonLd } from '@lib/json-ld';
66const tools = await getCollection (' tools' );
77const featuredTools = tools .filter (t => t .data .featured ).slice (0 , 6 );
88
9+ const base = import .meta .env .BASE_URL ;
910const siteUrl = Astro .site ?.toString ().replace (/ \/ $ / , ' ' ) || ' https://devtools.example.com' ;
1011
1112const jsonLd = generateWebsiteJsonLd ({
@@ -31,7 +32,7 @@ const jsonLd = generateWebsiteJsonLd({
3132 </p >
3233 <div class =" flex flex-wrap gap-4 justify-center" >
3334 <a
34- href =" / tools"
35+ href ={ ` ${ base } tools` }
3536 class =" px-8 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors"
3637 >
3738 Browse All Tools
@@ -77,7 +78,7 @@ const jsonLd = generateWebsiteJsonLd({
7778 Featured Tools
7879 </h2 >
7980 <a
80- href =" / tools"
81+ href ={ ` ${ base } tools` }
8182 class =" text-blue-600 dark:text-blue-400 hover:underline font-medium"
8283 >
8384 View All →
@@ -87,7 +88,7 @@ const jsonLd = generateWebsiteJsonLd({
8788 <div class =" grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" >
8889 { featuredTools .map ((tool ) => (
8990 <a
90- href = { ` / tools/${tool .id }` }
91+ href = { ` ${ base } tools/${tool .id }` }
9192 class = " group block p-6 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 hover:border-blue-500 dark:hover:border-blue-400 hover:shadow-lg transition-all"
9293 >
9394 <div class = " flex items-start gap-4" >
@@ -119,7 +120,7 @@ const jsonLd = generateWebsiteJsonLd({
119120 <div class =" grid grid-cols-2 md:grid-cols-4 gap-4" >
120121 { [' Encoding' , ' Formatting' , ' Conversion' , ' Generation' , ' Security' ].map ((category ) => (
121122 <a
122- href = { ` / tools?category=${category .toLowerCase ()}` }
123+ href = { ` ${ base } tools?category=${category .toLowerCase ()}` }
123124 class = " p-4 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 hover:border-blue-500 dark:hover:border-blue-400 transition-colors text-center"
124125 >
125126 <span class = " font-medium text-gray-900 dark:text-white" >{ category } </span >
0 commit comments