summaryrefslogtreecommitdiff
path: root/src/layouts/Layout.astro
blob: 6da5c0a90e0d391ab1602d412a7f64cca1087597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
import Footer from '$components/Footer.astro';
import Navbar from '$components/Navbar/Navbar.astro';
import translate from '$i18n/translate';
import tFeed from '$i18n/translations/pages/rss.xml';
import site from '$i18n/translations/site';
import getLocaleFromPath from '$lib/getLocaleFromPath';

interface Props {
  title: string;
}

const { title } = Astro.props;
const locale = getLocaleFromPath(Astro.url.pathname);
const t = translate(locale);
---

<!DOCTYPE html>
<html lang="sco">
  <head>
    <meta charset="UTF-8" />
    <meta name="description" content={t(site, { key: 'description' })} />
    <meta name="viewport" content="width=device-width" />
    <link rel="icon" href="/favicon.ico" />
    <link rel="sitemap" href="/sitemap-index.xml" />
    <link rel="stylesheet" href="/normalize.css" />
    <link rel="stylesheet" href="/main.css" />
    <link
      rel="alternate"
      type="application/rss+xml"
      title={t(tFeed, { key: 'title' })}
      href={`/${locale}/rss.xml`}
    />
    <meta name="generator" content={Astro.generator} />
    <title>{title} | {t(site, { key: 'title' })}</title>
  </head>
  <body id="top">
    <a class="btn skip-to-content" href="#main">Skip to content</a>
    <Navbar />
    <slot />
    <Footer />
  </body>
</html>