update content
This commit is contained in:
parent
f13cb160f3
commit
836f960a28
27 changed files with 459 additions and 472 deletions
|
|
@ -1,39 +1,75 @@
|
|||
import { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
|
||||
import { getArtifacts } from "@utils";
|
||||
|
||||
import styles from "./page.module.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "ryan christoffersen | artifacts",
|
||||
};
|
||||
|
||||
const ArtifactsPage = () => {
|
||||
async function getArtifactsByGroup() {
|
||||
return [
|
||||
{
|
||||
group: "essays",
|
||||
items: getArtifacts("essays").sort((a, b) => b.order - a.order),
|
||||
},
|
||||
{
|
||||
group: "film / video",
|
||||
items: [...getArtifacts("film"), ...getArtifacts("videos")].sort(
|
||||
(a, b) => b.order - a.order,
|
||||
),
|
||||
},
|
||||
{
|
||||
group: "software",
|
||||
items: getArtifacts("software").sort((a, b) => b.order - a.order),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const ArtifactsPage = async () => {
|
||||
const artifacts = await getArtifactsByGroup();
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.content}>
|
||||
<h1>{"artifacts"}</h1>
|
||||
<p>
|
||||
<i>{"What do artifacts do?"}</i>
|
||||
</p>
|
||||
<hr />
|
||||
<h2>{"essays"}</h2>
|
||||
<p>
|
||||
<i>{"maybe something soon"}</i>
|
||||
</p>
|
||||
<hr />
|
||||
<h2>{"film / video"}</h2>
|
||||
<p>
|
||||
<i>
|
||||
<Link href="/artifacts/film">{"just this page for now"}</Link>
|
||||
</i>
|
||||
</p>
|
||||
<hr />
|
||||
<h2>{"software"}</h2>
|
||||
<p>
|
||||
<i>
|
||||
<Link href="/artifacts/software">{"just this page for now"}</Link>
|
||||
</i>
|
||||
</p>
|
||||
{!artifacts.length ? (
|
||||
<p>
|
||||
<i>{"failed to load artifacts"}</i>
|
||||
</p>
|
||||
) : (
|
||||
<div>
|
||||
{artifacts.map(({ group, items }) => (
|
||||
<div key={group} style={{ margin: "2em 0" }}>
|
||||
<h2>{group}</h2>
|
||||
<ul>
|
||||
{items.map(
|
||||
({
|
||||
id,
|
||||
category,
|
||||
title,
|
||||
description,
|
||||
created,
|
||||
updated,
|
||||
}) => (
|
||||
<li key={id}>
|
||||
<Link href={`/artifacts/` + category + "/" + id}>
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
<p>
|
||||
<i>{`created: ${created.toDateString()}`}</i>
|
||||
{" | "}
|
||||
<i>{`updated: ${updated.toDateString()}`}</i>
|
||||
</p>
|
||||
</Link>
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue