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