Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ relatedCampaigns:
---
```

> `authors` is required. Names must exactly match entries in `src/data/authors.json`. Add new authors to that file before referencing them. Validation errors on unknown authors block CI.
> `authors` is optional but recommended. Names must exactly match entries in `src/data/authors.json`. Add new authors to that file before referencing them. Missing `authors` produces a warning only and does not block CI. Unknown author names (not in `authors.json`) still produce an error and block CI.
>
> All five `related*` fields are parsed from frontmatter and rendered as related content sections on detail pages.

Expand Down
5 changes: 5 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const nextConfig: NextConfig = {
destination: "/research",
permanent: true,
},
{
source: "/contact",
destination: "/partner",
permanent: true,
},
];
},
async rewrites() {
Expand Down
4 changes: 2 additions & 2 deletions scripts/validate-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ function validateFile(filePath: string, contentType: ContentDir): { errors: stri
);
}

// Authors validation (required field)
// Authors validation (warning only — missing authors won't block merge)
if (data.authors === undefined || !Array.isArray(data.authors) || (data.authors as string[]).length === 0) {
errors.push("authors: required — must list at least one author");
warnings.push("authors: not set — consider adding at least one author");
} else {
validateAuthors(data.authors as string[], undefined, errors, warnings, "content");
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/cards/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export default function ContentCard({
<p className="text-gray-300 font-serif text-sm line-clamp-3 flex-grow">
{shortDescription}
</p>
{(authors || date) && (
{(authors?.length || date) && (
<div className="flex items-center justify-between mt-2 gap-2">
{authors && (
{authors && authors.length > 0 && (
<p className="text-xs text-gray-300 truncate">
By {authors.join(", ")}
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/components/layouts/CategoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ function ListRow({
<p className="text-sm text-gray-300 font-serif mt-0.5 line-clamp-2 sm:line-clamp-4">
{item.shortDescription}
</p>
{(showAuthor || showReadTime) && (
{((showAuthor && itemAuthors(item).length > 0) || showReadTime) && (
<p className="text-xs text-gray-500 mt-1.5">
{showAuthor && `By ${itemAuthors(item).join(", ")}`}
{showAuthor && showReadTime && " · "}
{showAuthor && itemAuthors(item).length > 0 && `By ${itemAuthors(item).join(", ")}`}
{showAuthor && itemAuthors(item).length > 0 && showReadTime && " · "}
{showReadTime && `${calcReadTime(item.description)} min read`}
</p>
)}
Expand Down
Loading