---
import BaseLayout from '../layouts/BaseLayout.astro';
import ProjectPostPreview from '../components/ProjectPostPreview.astro';

let allPosts = await Astro.glob('./posts/*.md');
//allPosts.sort((a,b) => new Date(b.publishDate) - new Date(a.publishDate));

---

<BaseLayout title="Projects - thomaspcole.com">
    <style lang="scss">
        .project-div{
            width: 100%;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
            place-items: center;
        }

        html{
            overflow: auto;
        }
    </style>

    <div class="project-div">
        {allPosts.map(p => <ProjectPostPreview post={p}/>)}
    </div>
</BaseLayout>