Wordpress is in
Some checks failed
ci / site (push) Has been cancelled

This commit is contained in:
2026-02-10 01:04:12 -05:00
parent d4aef77eca
commit c773affbc8
28 changed files with 1374 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
---
import type { WordpressPost } from "../lib/content/types";
type Props = {
post: WordpressPost;
};
const { post } = Astro.props;
function truncate(s: string, n: number) {
if (!s) return "";
const t = s.trim();
if (t.length <= n) return t;
return `${t.slice(0, Math.max(0, n - 1)).trimEnd()}…`;
}
---
<a class="blog-card" href={`/blog/post/${post.slug}`}>
{post.featuredImageUrl ? <img src={post.featuredImageUrl} alt="" loading="lazy" /> : null}
<div class="blog-card-body">
<h3 class="blog-card-title">{post.title}</h3>
<p class="blog-card-excerpt">{truncate(post.excerpt || "", 180)}</p>
</div>
</a>

View File

@@ -0,0 +1,25 @@
---
import type { WordpressCategory } from "../lib/content/types";
type Props = {
categories: WordpressCategory[];
activeCategorySlug?: string;
};
const { categories, activeCategorySlug } = Astro.props;
---
<nav class="subnav" aria-label="Blog categories">
<a class={!activeCategorySlug ? "active" : ""} href="/blog">
All
</a>
<a class={activeCategorySlug === "__pages" ? "active" : ""} href="/blog/pages">
Pages
</a>
{categories.map((c) => (
<a class={activeCategorySlug === c.slug ? "active" : ""} href={`/blog/category/${c.slug}`}>
{c.name}
</a>
))}
</nav>