Recent Blog Posts


See full post archive ...


The Code For This Page:

This is src/pages/blog.astro which is generated from markdown files located in src/pages/posts/ using:
---
import BaseLayout from '../layouts/BaseLayout.astro';
import { Markdown } from 'astro/components'
let allPosts = await Astro.glob('../pages/posts/*.md');
allPosts.sort((a, b) => Date.parse(b.frontmatter.date) - Date(a.frontmatter.date));
---
<div>
    {allPosts.slice(0, 5).map((post) => (
    <article>
        <img src={post.frontmatter.hero} alt={post.frontmatter.alt} width="100"><a href={post.url}><h3>{post.frontmatter.title}</h3></a>
        <p>{post.frontmatter.description}</p>
        
        <div>
        {post.frontmatter.tags.map((item) => <div><a href={'/tags/${item}'}>{item}</a></div>)}
        </div>
        
        <a href={post.url}>Read more</a>
        <hr>
    </article>
    ))}
</div>