add updates and fix shippy

This commit is contained in:
haetae 2025-09-22 16:34:59 -04:00
parent c8cce26569
commit 3c3d596c9c
3 changed files with 12 additions and 5 deletions

View File

@ -4,6 +4,7 @@ export default {
username: "haetae", username: "haetae",
remoteProjectPath: "/var/www/fujohost/haetae/", remoteProjectPath: "/var/www/fujohost/haetae/",
remoteDbPath: "/var/www/fujohost/haetae/guestbook.db", remoteDbPath: "/var/www/fujohost/haetae/guestbook.db",
dbDriver: "astro:db" dbDriver: "astro:db",
privateKeyPath: "/home/ayowaddup/.ssh/shippy.id_ed25519"
} }
}; };

View File

@ -1,9 +1,11 @@
--- ---
import { db, desc, Guestbook } from "astro:db"; import { desc } from "drizzle-orm";
import { db } from "db";
import { guestbookTable } from "db/schema";
import formatDate from "@/utils/formatDate"; import formatDate from "@/utils/formatDate";
import pikachu from "$/images/portrait-0025.png"; import pikachu from "$/images/portrait-0025.png";
const entries = await db.select().from(Guestbook).orderBy(desc(Guestbook.published)); const entries = await db.select().from(guestbookTable).orderBy(desc(guestbookTable.published));
--- ---
<section id="entries"> <section id="entries">
{entries.map(entry => ( {entries.map(entry => (
@ -16,7 +18,7 @@ const entries = await db.select().from(Guestbook).orderBy(desc(Guestbook.publish
? <a href={entry.website} target="_blank" referrerpolicy="no-referrer">{entry.username}</a> ? <a href={entry.website} target="_blank" referrerpolicy="no-referrer">{entry.username}</a>
: <span>{entry.username}</span>} : <span>{entry.username}</span>}
</h1> </h1>
<time datetime={entry.published.toISOString()}> <time datetime={entry.published}>
{formatDate(entry.published, false, 'MMMM D, YYYY')} {formatDate(entry.published, false, 'MMMM D, YYYY')}
</time> </time>
</header> </header>
@ -32,7 +34,7 @@ const entries = await db.select().from(Guestbook).orderBy(desc(Guestbook.publish
<div class="entry"> <div class="entry">
<header> <header>
<h1>Reply to {entry.username}</h1> <h1>Reply to {entry.username}</h1>
<time datetime={entry.updated?.toISOString()}> <time datetime={entry.updated}>
{formatDate(entry.updated!, false, 'MMMM D, YYYY')} {formatDate(entry.updated!, false, 'MMMM D, YYYY')}
</time> </time>
</header> </header>

View File

@ -1,5 +1,8 @@
--- ---
import { getCollection } from "astro:content";
import UpdateCard from "./UpdateCard.astro"; import UpdateCard from "./UpdateCard.astro";
const updates = await getCollection("updates");
--- ---
<section id="updates"> <section id="updates">
<header> <header>
@ -17,6 +20,7 @@ import UpdateCard from "./UpdateCard.astro";
</h2> </h2>
<UpdateCard title="redo gallery and guestbook" date="2024-05-10"> <UpdateCard title="redo gallery and guestbook" date="2024-05-10">
{updates.length}
<p>redid <a href="/gallery">gallery page</a> to make adding images easier and added alpinejs to <a href="/guestbook">guestbook</a> for fetching entries live</p> <p>redid <a href="/gallery">gallery page</a> to make adding images easier and added alpinejs to <a href="/guestbook">guestbook</a> for fetching entries live</p>
</UpdateCard> </UpdateCard>