mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-15 07:55:41 +00:00
Ryan Freeman
4a1b7fa6ef
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m22s
55 lines
2.1 KiB
TypeScript
55 lines
2.1 KiB
TypeScript
import React from 'react'
|
|
import {SimpleLayout} from '@/components/layouts/SimpleLayout'
|
|
import {Card} from '@/components/ui/Card'
|
|
import {Views} from '@/components/ui/Views'
|
|
import {formatDate} from '@/lib/formatDate'
|
|
import {getAllArticles} from '@/lib/getAllArticles'
|
|
import type {Article} from '@/types'
|
|
|
|
export const metadata = {
|
|
title: 'Writing - Ryan Freeman',
|
|
description: 'All of my long-form thoughts on software engineering, and more, displayed in chronological order.'
|
|
}
|
|
|
|
function Article({article}: { article: Article }) {
|
|
return (
|
|
<article>
|
|
<Card variant="inline">
|
|
<Card.Title href={`/writing/${article.slug}`}>
|
|
{article.title}
|
|
</Card.Title>
|
|
<p className="flex order-first space-x-1 z-10 mb-3 md:mb-0 md:ml-4 md:order-last flex-shrink-0">
|
|
<Card.Eyebrow as="time" dateTime={article.date} decorate={false}>
|
|
{formatDate(article.date)}
|
|
</Card.Eyebrow>
|
|
<Views
|
|
slug={article.slug}
|
|
className="text-sm text-zinc-500 dark:text-zinc-400"
|
|
shouldUpdateViews={false}
|
|
/>
|
|
</p>
|
|
</Card>
|
|
</article>
|
|
)
|
|
}
|
|
|
|
export default async function Writing() {
|
|
const articles = (await getAllArticles()).map(({component, ...meta}) => meta)
|
|
|
|
return (
|
|
<SimpleLayout
|
|
heading="Writing on software engineering, and everything in between."
|
|
description={metadata.description}
|
|
gradient="bg-gradient-to-r from-pink-500 to-violet-500"
|
|
>
|
|
<div className="mx-auto grid max-w-xl grid-cols-1 gap-y-20 lg:max-w-none">
|
|
<div className="max-w-3xl space-y-16 mt-6">
|
|
{articles.map((article) => (
|
|
<Article key={article.slug} article={article}/>
|
|
))}
|
|
</div>
|
|
</div>
|
|
<Views slug="/writing" shouldUpdateViews={true} shouldRender={false}/>
|
|
</SimpleLayout>
|
|
)
|
|
} |