2026-06-05 14:31:12 -06:00
|
|
|
---
|
|
|
|
|
import Layout from '../../layouts/Layout.astro';
|
|
|
|
|
import { getCollection, getEntry, render } from 'astro:content';
|
|
|
|
|
import { type CollectionEntry } from 'astro:content';
|
|
|
|
|
import { dateFormat } from '../../utils/date';
|
|
|
|
|
import { urlfrag } from '../../utils/path';
|
|
|
|
|
import { titleCase } from '../../utils/strings';
|
|
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
note: CollectionEntry<'notes'>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function getStaticPaths() {
|
|
|
|
|
const notes = await getCollection('notes');
|
|
|
|
|
return notes.map((note: CollectionEntry<'notes'>) => ({
|
2026-07-07 15:33:28 -06:00
|
|
|
params: { id: note.id.replace(/-/, '/') },
|
2026-06-05 14:31:12 -06:00
|
|
|
props: { note },
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const base = import.meta.env.BASE_URL;
|
|
|
|
|
const { note } = Astro.props;
|
|
|
|
|
const { Content } = await render(note);
|
|
|
|
|
|
|
|
|
|
const meta = `{
|
|
|
|
|
"@context": "https://schema.org",
|
|
|
|
|
"@type": "BlogPosting",
|
2026-06-06 23:26:44 -06:00
|
|
|
"headline": "${note.data.title}",
|
|
|
|
|
"image": "${urlfrag(base, note.data.post_image)}",
|
2026-06-05 14:31:12 -06:00
|
|
|
"author": {"@type": "Person", "name": "Benjamin A. Shelton"},
|
|
|
|
|
"publisher": {"@type": "Organization", "name": "Just Us"},
|
2026-06-06 23:26:44 -06:00
|
|
|
"datePublished": "${note.data.date.toISOString()}",
|
|
|
|
|
"dateModified": "${note.data.date.toISOString()}"
|
2026-06-05 14:31:12 -06:00
|
|
|
}`;
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-06-30 15:14:04 -06:00
|
|
|
<Layout title=`${note.data.title} - ${note.data.sub_heading}`>
|
2026-06-05 14:31:12 -06:00
|
|
|
{meta && <script type="application/ld+json" is:inline set:html={meta} />}
|
|
|
|
|
<article class="mx-auto p-4 lg:p-0 lg:max-w-6xl xl:p-0 xl:max-w-6xl 2xl:p-0 2xl:max-w-6xl" id="notes-page">
|
2026-06-11 18:57:20 -06:00
|
|
|
<div class="header">
|
|
|
|
|
<hgroup>
|
|
|
|
|
<h1 id="title">{note.data.title}</h1>
|
|
|
|
|
<h2 id="subtitle">{note.data.sub_heading}</h2>
|
|
|
|
|
</hgroup>
|
|
|
|
|
<section id="meta">
|
|
|
|
|
<time>{dateFormat(note.data.date)}</time>
|
|
|
|
|
<span class="divider">
|
|
|
|
|
<ul class="tags">
|
|
|
|
|
{note.data.tags?.filter((tag: string) => (tag != 'notes')).map((tag: string) => (
|
|
|
|
|
<li>{titleCase(tag)}</li>
|
|
|
|
|
))}</ul>
|
|
|
|
|
</section>
|
2026-06-05 14:31:12 -06:00
|
|
|
</div>
|
|
|
|
|
<div id="content" class="p-6">
|
|
|
|
|
<Content />
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
</Layout>
|