---
import ArticleList from '../components/ArticleList.astro';
import Page from '../layouts/Page.astro';
import { getPublishedPosts } from '../lib/site';

const posts = await getPublishedPosts();
const recent = posts.slice(0, 5);
---

<Page
  title="Not Found"
  description="The page you are looking for does not exist."
  noindex
>
  <div class="empty-state">
    <p>
      Try the <a href="/articles/">articles archive</a>, the
      <a href="/projects/">project index</a>, the
      <a href="/tags/">tag index</a>, or head back to the
      <a href="/">homepage</a>.
    </p>
  </div>

  <section class="home-section">
    <div class="section-heading">
      <h2 id="recent-articles-404">Recent articles</h2>
      <a href="/articles/">All articles <span aria-hidden="true">→</span></a>
    </div>
    <ArticleList posts={recent} />
  </section>
</Page>
