feat(layout): add noindex, nofollow options

This commit is contained in:
Jewgeni Lewash 2024-03-15 07:07:45 +01:00
parent 52dd0a7853
commit 1730207b88

View File

@ -7,17 +7,24 @@ import Footer from '@/components/layout/Footer.astro';
interface Props { interface Props {
title: string; title: string;
description: string; description: string;
lang?: string;
index?: boolean;
follow?: boolean;
} }
const { title, description } = Astro.props as Props; const { title, description, lang = 'en', index, follow } = Astro.props as Props;
--- ---
<html lang="en"> <html lang={lang}>
<head> <head>
<title>{title}</title> <title>{title}</title>
<meta name="description" content={description} /> <meta name="description" content={description} />
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#61a8e1" /> <meta name="theme-color" content="#61a8e1" />
<meta
name="robots"
content={`${index ? 'index' : 'noindex'}, ${follow ? 'follow' : 'nofollow'}`}
/>
<link rel="icon" href="/favicon.ico" sizes="48x48" /> <link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" /> <link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
<link rel="manifest" href="/site.webmanifest" /> <link rel="manifest" href="/site.webmanifest" />