diff --git a/CLAUDE.md b/CLAUDE.md index e88119a0..c7e51f25 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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. diff --git a/next.config.ts b/next.config.ts index cac0bf02..b53d2dc4 100644 --- a/next.config.ts +++ b/next.config.ts @@ -41,6 +41,11 @@ const nextConfig: NextConfig = { destination: "/research", permanent: true, }, + { + source: "/contact", + destination: "/partner", + permanent: true, + }, ]; }, async rewrites() { diff --git a/scripts/validate-content.ts b/scripts/validate-content.ts index 67213923..4393b839 100644 --- a/scripts/validate-content.ts +++ b/scripts/validate-content.ts @@ -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"); } diff --git a/src/components/cards/ContentCard.tsx b/src/components/cards/ContentCard.tsx index 21e4040a..4215d137 100644 --- a/src/components/cards/ContentCard.tsx +++ b/src/components/cards/ContentCard.tsx @@ -89,9 +89,9 @@ export default function ContentCard({
{shortDescription}
- {(authors || date) && ( + {(authors?.length || date) && (By {authors.join(", ")}
diff --git a/src/components/layouts/CategoryContent.tsx b/src/components/layouts/CategoryContent.tsx index 6313f186..ea1eeb4b 100644 --- a/src/components/layouts/CategoryContent.tsx +++ b/src/components/layouts/CategoryContent.tsx @@ -213,10 +213,10 @@ function ListRow({{item.shortDescription}
- {(showAuthor || showReadTime) && ( + {((showAuthor && itemAuthors(item).length > 0) || showReadTime) && (- {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`}
)}