---
import '../../styles/normalize.css';
import DefaultArchive from '../../components/DefaultArchive.astro';
import YarArchive from '../../components/themes/yar/YarArchive.astro';
import SeoHead from '../../components/seo/SeoHead.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;
const description = `${site.title} 的文章归档`;
---

<!doctype html>
<html lang={site.language}>
  <head>
    <SeoHead title="归档" description={description} path="/archive/" />
  </head>
  <body>
    <ArchiveView archiveYears={archiveYears} />
  </body>
</html>
