feat: update site URLs and enhance image handling
- Changed site URLs in docker-compose and deployment configurations to remove "www" prefix for consistency. - Improved image handling by introducing warmPostCardImages function for pre-fetching images in posts and tags. - Enhanced PostCard component with responsive image sizes for better performance. - Updated layout to include robots meta tag and JSON-LD structured data for improved SEO. - Added loading state for images in TopBanner component to enhance user experience.
This commit is contained in:
+20
-1
@@ -39,7 +39,15 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
event.locals.translations = {};
|
||||
}
|
||||
|
||||
const response = await resolve(event);
|
||||
const response = await resolve(event, {
|
||||
preload: ({ type, path }) => {
|
||||
if (type === 'js' || type === 'css') return true;
|
||||
if (type === 'font') {
|
||||
return /inter-latin-(400|700)-normal\.[a-f0-9]*\.?woff2$/i.test(path);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
});
|
||||
|
||||
if (
|
||||
event.request.method === 'GET' &&
|
||||
@@ -49,5 +57,16 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
response.headers.set('cache-control', PAGE_CACHE_CONTROL);
|
||||
}
|
||||
|
||||
if (
|
||||
event.request.method === 'GET' &&
|
||||
!response.headers.has('x-robots-tag') &&
|
||||
(response.headers.get('content-type') ?? '').includes('text/html')
|
||||
) {
|
||||
response.headers.set(
|
||||
'x-robots-tag',
|
||||
'index, follow, max-image-preview:large, max-snippet:-1',
|
||||
);
|
||||
}
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user