feat: add meta tag to prevent indexing by crawlers
- add page title - update typing
This commit is contained in:
@@ -3,7 +3,7 @@ import { env as publicEnv } from '$env/dynamic/public';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { mapFooterData, mapHeaderData } from '$lib/mapping/strapiMapping.svelte.js';
|
||||
import type { StrapiComponentUnion } from '$lib/types/strapi';
|
||||
import type { StrapiFooterResponse, StrapiHomepageResponse } from '$lib/types/strapi';
|
||||
|
||||
export const load: LayoutServerLoad = async () => {
|
||||
const query = new URLSearchParams({
|
||||
@@ -42,14 +42,13 @@ export const load: LayoutServerLoad = async () => {
|
||||
throw error(500, 'Failed to connect to the CMS');
|
||||
}
|
||||
|
||||
const [homepageData, footerData] = await Promise.all([
|
||||
homepageResponse.value.json(),
|
||||
footerResponse.value.json()
|
||||
]);
|
||||
const [homepageData, footerData]: [StrapiHomepageResponse, StrapiFooterResponse] =
|
||||
await Promise.all([homepageResponse.value.json(), footerResponse.value.json()]);
|
||||
|
||||
return {
|
||||
title: homepageData.data.title,
|
||||
header: mapHeaderData(homepageData),
|
||||
components: homepageData.data.components as StrapiComponentUnion[],
|
||||
components: homepageData.data.components,
|
||||
footer: mapFooterData(footerData)
|
||||
};
|
||||
};
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
<svelte:head>
|
||||
<link rel="icon" href={favicon} />
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{data.title}</title>
|
||||
</svelte:head>
|
||||
|
||||
<Header {...data.header} />
|
||||
|
||||
Reference in New Issue
Block a user