Load home portfolio views from API; improve resume PDF layout

Stop hardcoding deleted audience views and re-seeding them on boot.
Tighten resume print CSS with professional fonts and page-break rules
for a cleaner 1–2 page Letter PDF.
This commit is contained in:
2026-08-01 11:28:51 -04:00
parent c4ecc934e9
commit af4e658e72
4 changed files with 267 additions and 125 deletions
+20 -8
View File
@@ -1,6 +1,12 @@
import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { api, type Project, type SiteSettings, type Category } from "../lib/api";
import {
api,
type Project,
type SiteSettings,
type Category,
type PortfolioView,
} from "../lib/api";
import { ProjectCard } from "../components/ProjectCard";
import { usePageTitle } from "../lib/pageTitle";
import "./HomePage.scss";
@@ -10,6 +16,7 @@ export function HomePage() {
const [featured, setFeatured] = useState<Project[]>([]);
const [recent, setRecent] = useState<Project[]>([]);
const [categories, setCategories] = useState<Category[]>([]);
const [views, setViews] = useState<PortfolioView[]>([]);
usePageTitle(null); // site name only
@@ -19,11 +26,13 @@ export function HomePage() {
api.featured().catch(() => [] as Project[]),
api.projects({ sort: "date", perPage: 6 }),
api.categories(),
]).then(([s, f, r, c]) => {
api.views().catch(() => [] as PortfolioView[]),
]).then(([s, f, r, c, v]) => {
setSite(s);
setFeatured(f);
setRecent(r.data);
setCategories(c);
setViews(v);
});
}, []);
@@ -68,12 +77,15 @@ export function HomePage() {
)}
</Link>
))}
<Link to="/portfolio/game-dev" className="home-cats__chip home-cats__chip--view">
Game Dev view
</Link>
<Link to="/portfolio/engineering" className="home-cats__chip home-cats__chip--view">
Engineering view
</Link>
{views.map((v) => (
<Link
key={v.id}
to={`/portfolio/${v.slug}`}
className="home-cats__chip home-cats__chip--view"
>
{v.name}
</Link>
))}
</div>
</section>
+5 -4
View File
@@ -516,16 +516,17 @@ export function AdminDashboard() {
</section>
<section style={{ marginTop: "2.5rem" }}>
<h2 style={{ fontSize: "1rem", color: "var(--text-muted)" }}>Quick links for audiences</h2>
<h2 style={{ fontSize: "1rem", color: "var(--text-muted)" }}>Quick links</h2>
<ul style={{ color: "var(--text-dim)", lineHeight: 1.9 }}>
<li>
<code>/portfolio/game-dev</code> animation first, then modeling
<code>/portfolio</code> full portfolio
</li>
<li>
<code>/portfolio/engineering</code> CAD & product visualization first
<code>/portfolio/&lt;category-slug&gt;</code> category filter (example:{" "}
<code>/portfolio/photography</code>)
</li>
<li>
<code>/portfolio/3d</code>, <code>/portfolio/cad</code>, <code>/portfolio/ai</code>
<code>/portfolio/&lt;view-slug&gt;</code> audience views from Admin Portfolio Views
</li>
<li>
<code>/resume</code> shareable resume URL