---
import { getCollection } from 'astro:content'

import PageLayout from '@layouts/PageLayout.astro'

const guides = await getCollection('guides')
---

<PageLayout pageTags="guide">
    <h1>Guide</h1>
    <div class="card-list">
        {
            guides.map(guide => (
                <div class="card">
                    <div class="title">
                        <a href={`/guide/${guide.slug}`}>{guide.data.title}</a>
                    </div>
                    <div class="text">{guide.data.description}</div>
                    <div class="tags">
                        {guide.data.tags.map(tag => (
                            <a href={`/guide/tags/${tag}`}>#{tag}</a>
                        ))}
                    </div>
                </div>
            ))
        }
    </div>
</PageLayout>
