diff --git a/.github/workflows/publish-content.yml b/.github/workflows/publish-content.yml index 1a74d66d..73d5e1b7 100644 --- a/.github/workflows/publish-content.yml +++ b/.github/workflows/publish-content.yml @@ -110,7 +110,7 @@ jobs: await github.rest.checks.create({ owner: context.repo.owner, repo: context.repo.repo, - name: 'Validate content / validate', + name: 'validate', head_sha: '${{ steps.create-pr.outputs.pull-request-head-sha }}', status: 'completed', conclusion, diff --git a/src/app/api/preview/route.ts b/src/app/api/preview/route.ts index 3670110f..168b3c69 100644 --- a/src/app/api/preview/route.ts +++ b/src/app/api/preview/route.ts @@ -98,7 +98,7 @@ async function parseContentFile(filename: string, ref: string, headers: Record s.replace(/^`(.*)`$/, "$1").trim()) + .map((s) => s.replace(/^`(.*)`$/, "$1").replace(/^"(.*)"$/, "$1").trim()) .filter((s) => s && s !== "-"); // Legacy format: bullet points (- slug) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index a65e995c..d21d6a21 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -5,7 +5,8 @@ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } -export function calcReadTime(text: string): number { +export function calcReadTime(text: string | undefined | null): number { + if (!text) return 1; const wordCount = text.trim().split(/\s+/).filter(Boolean).length; return Math.max(1, Math.ceil(wordCount / 265)); }