---
// Import the global.css file here so that it is included on
// all pages through the use of the <BaseHead /> component.
import '../styles/app.css'

import type { SiteMeta } from '@/types'
import { siteConfig } from '@/site-config'

type Props = SiteMeta
import { ViewTransitions } from 'astro:transitions'
const { articleDate, description, ogImage, title } = Astro.props

const titleSeparator = '•'
const siteTitle = `${title} ${titleSeparator} ${siteConfig.title}`
const canonicalURL = new URL(Astro.url.pathname, Astro.site)
const socialImageURL = new URL(ogImage ? ogImage : '/social-card.png', Astro.url).href
---

<meta charset='utf-8' />
<meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' />
<meta content='IE=edge' http-equiv='X-UA-Compatible' />
<meta name='baidu-site-verification' content='codeva-ZWUil8ENc0' />
<meta name='google-adsense-account' content='ca-pub-6184816340945344' />
<script
	async
	src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6184816340945344'
	crossorigin='anonymous'></script>

<script type='text/javascript'>
	;(function (c, l, a, r, i, t, y) {
		c[a] =
			c[a] ||
			function () {
				;(c[a].q = c[a].q || []).push(arguments)
			}
		t = l.createElement(r)
		t.async = 1
		t.src = 'https://www.clarity.ms/tag/' + i
		y = l.getElementsByTagName(r)[0]
		y.parentNode.insertBefore(t, y)
	})(window, document, 'clarity', 'script', 'kvbyuhu6d2')
</script>
<!-- Google tag (gtag.js) -->
<script async src='https://www.googletagmanager.com/gtag/js?id=G-F4KLD4XCDB'></script>
<script>
	window.dataLayer = window.dataLayer || []
	function gtag() {
		dataLayer.push(arguments)
	}
	gtag('js', new Date())

	gtag('config', 'G-F4KLD4XCDB')
</script>

<title>{siteTitle}</title>

{/* Icons / Favicon */}
<!-- <link href="favicon/favicon.ico" rel="icon" sizes="any" />
<link href="favicon/icon.svg" rel="icon" type="image/svg+xml" />
<link href="/apple-touch-icon.png" rel="apple-touch-icon" />
<link href="/manifest.webmanifest" rel="manifest" /> -->

<link rel='apple-touch-icon' sizes='180x180' href='/favicon/apple-touch-icon.png' />
<link rel='icon' type='image/png' sizes='32x32' href='/favicon/favicon-32x32.png' />
<link rel='icon' type='image/png' sizes='16x16' href='/favicon/favicon-16x16.png' />
<link rel='manifest' href='/favicon/site.webmanifest' />

{/* Font preloads */}
<!-- <link rel='preload' href='/fonts/Satoshi-Variable.ttf' as='font' type='font/ttf' crossorigin />
<link
	rel='preload'
	href='/fonts/Satoshi-VariableItalic.ttf'
	as='font'
	type='font/ttf'
	crossorigin
/>
<link rel='preload' href='/fonts/ClashDisplay-Variable.ttf' as='font' type='font/ttf' crossorigin /> -->

{/* Canonical URL */}
<link rel='canonical' href={canonicalURL} />

{/* Primary Meta Tags */}
<meta content={siteTitle} name='title' />
<meta content={description} name='description' />
<meta content={siteConfig.author} name='author' />

{/* Theme Colour */}
<meta content='' name='theme-color' />

{/* Open Graph / Facebook */}
<meta content={articleDate ? 'article' : 'website'} property='og:type' />
<meta content={title} property='og:title' />
<meta content={description} property='og:description' />
<meta content={canonicalURL} property='og:url' />
<meta content={siteConfig.title} property='og:site_name' />
<meta content={siteConfig.ogLocale} property='og:locale' />
<meta content={socialImageURL} property='og:image' />
<meta content='1200' property='og:image:width' />
<meta content='630' property='og:image:height' />
{
	articleDate && (
		<>
			<meta content={siteConfig.author} property='article:author' />
			<meta content={articleDate} property='article:published_time' />
		</>
	)
}

{/* Twitter */}
<meta content='summary_large_image' property='twitter:card' />
<meta content={canonicalURL} property='twitter:url' />
<meta content={title} property='twitter:title' />
<meta content={description} property='twitter:description' />
<meta content={socialImageURL} property='twitter:image' />

{/* Sitemap */}
<link href='/sitemap-index.xml' rel='sitemap' />

{/* RSS auto-discovery */}
<link href='/rss.xml' rel='alternate' title={siteConfig.title} type='application/rss+xml' />

<meta content={Astro.generator} name='generator' />

<ViewTransitions />
