- Replaced global navbar, now mobile friendly

- Corrected sizing of LyricSearchInputField
- Removed sitemap from auto-generated robots.txt
This commit is contained in:
2025-11-22 12:12:56 -05:00
parent 8d6bc3d10f
commit e4d2b4ec05
4 changed files with 262 additions and 65 deletions

20
src/middleware.js Normal file
View File

@@ -0,0 +1,20 @@
import { defineMiddleware } from 'astro:middleware';
export const onRequest = defineMiddleware(async (context, next) => {
try {
// Let Astro handle the request first
const response = await next();
// If it's a 404, redirect to home
if (response.status === 404) {
console.log(`404 redirect: ${context.url.pathname} -> /`);
return context.redirect('/', 302);
}
return response;
} catch (error) {
// Handle any middleware errors by redirecting to home
console.error('Middleware error:', error);
return context.redirect('/', 302);
}
});