--- import Layout from '../layouts/Layout.astro'; import FormattedDate from '../components/FormattedDate.astro'; import directus from '../../lib/directus'; import { readItems, readSingleton } from '@directus/sdk'; const global = await directus.request(readSingleton('global')); const posts = await directus.request( readItems('posts', { fields: ['*'], sort: ['-published_date'], }) ); const recentPosts = posts .sort((a, b) => b.published_date.getTime() - a.published_date.getTime()) .slice(0, 3); const allTags = [...new Set(posts.flatMap((post) => post.tags || []))].slice(0, 5); ---

Writing on technology, development, and selfhosting.

{global.about}

Recent Posts

View all posts
{ recentPosts.map((post, index) => ( )) }
{ allTags.length > 0 && (

Explore Topics

{allTags.map((tag) => { const tagCount = posts.filter((post) => post.tags && post.tags.includes(tag)).length; return (
#{tag} {tagCount} {tagCount === 1 ? 'post' : 'posts'}

Explore articles about {tag}

); })}
) }