/
AlexandrNarbaev
/
ThePath
Обзор
Документация
Войти
/
AlexandrNarbaev
/
ThePath
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
web/src/layouts/BaseLayout.astro
68 строк
3 KB
AlexandrNarbaev
fix: use real GoatCounter code (alex-narbaev) and update .env.example with real key format
05 июн 2026, 00:31
05 июн 2026, 00:31
137a097
Код
Авторство
О чём код?
--- import Nav from '../components/Nav.astro'; import Footer from '../components/Footer.astro'; import { t, type Lang } from '../i18n/ui'; import '../styles/global.css'; interface Props { lang: Lang; title: string; description?: string; ogType?: string; } const { lang, title, description, ogType = 'website' } = Astro.props; const siteName = t('site.name', lang); const pageDesc = description ?? t('hero.subtitle', lang); const base = '/ThePath'; --- <!doctype html> <html lang={lang} data-theme="dark"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>{title} — {siteName}</title> <meta name="description" content={pageDesc} /> <link rel="icon" type="image/x-icon" href="/ThePath/favicon.ico" /> <link rel="apple-touch-icon" href="/ThePath/apple-touch-icon.png" /> <link rel="manifest" href="/ThePath/manifest.json" /> <meta name="theme-color" content="#e6c17b" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content={`${title} — ${siteName}`} /> <meta name="twitter:description" content={pageDesc} /> <meta property="og:title" content={`${title} — ${siteName}`} /> <meta property="og:description" content={pageDesc} /> <meta property="og:type" content={ogType} /> <meta property="og:site_name" content={siteName} /> <link rel="canonical" href={new URL(Astro.url.pathname, Astro.url).href} /> <meta property="og:url" content={new URL(Astro.url.pathname, Astro.url).href} /> <meta property="og:locale" content={lang === 'ru' ? 'ru_RU' : 'en_US'} /> <meta property="og:image" content={`${base}/og-image.svg`} /> <meta property="og:image:width" content="1200" /> <meta property="og:image:height" content="630" /> <meta name="twitter:image" content={`${base}/og-image.svg`} /> <meta name="robots" content="index, follow" /> {lang === 'ru' ? ( <link rel="alternate" hreflang="en" href={`${base}${Astro.url.pathname.replace(base, '').replace('/ru/', '/en/')}`} /> ) : ( <link rel="alternate" hreflang="ru" href={`${base}${Astro.url.pathname.replace(base, '').replace('/en/', '/ru/')}`} /> )} <script is:inline> (() => { const s = localStorage.getItem('theme'); const p = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; document.documentElement.setAttribute('data-theme', s || p); })(); </script> <script data-goatcounter="https://alex-narbaev.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script> <script type="application/ld+json" set:html={JSON.stringify({ '@context': 'https://schema.org', '@type': 'WebSite', name: siteName, url: Astro.url.origin + base, description: pageDesc, inLanguage: lang, })} /> </head> <body class="min-h-screen flex flex-col"> <a href="#main-content" class="skip-link">{t('skip_to_content', lang)}</a> <Nav lang={lang} /> <main id="main-content" class="flex-1"> <slot /> </main> <Footer lang={lang} /> </body> </html>