---
import '../../styles/normalize.css';
import DefaultArchive from '../../components/DefaultArchive.astro';
import YarArchive from '../../components/themes/yar/YarArchive.astro';
import { site } from '../../lib/siteConfig';
import { getArchiveYears } from '../../lib/posts';

const archiveYears = getArchiveYears();
const theme = site.theme?.trim().toLowerCase() ?? 'default';
const ArchiveView = theme === 'yar' ? YarArchive : DefaultArchive;
---

<!doctype html>
<html lang={site.language}>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Archive | {site.title}</title>
    <meta name="description" content={`Archive of ${site.title}`} />
  </head>
  <body>
    <ArchiveView archiveYears={archiveYears} />
  </body>
</html>
