diff --git a/src/content/config.ts b/src/content/config.ts index cb4e0ee..49d9e86 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -32,6 +32,9 @@ const posts = defineCollection({ // backward compat with existing frontmatter but no longer rendered. topic: z.string().optional(), topicId: z.enum(TOPIC_IDS), + // A writer-suggested topic not yet in TOPIC_IDS — surfaced for a maintainer + // (or automation) to create the topic or remap topicId. Ignored by rendering. + proposedTopic: z.string().optional(), tags: z.array(z.string()).optional(), updated: z.coerce.date().optional(), cover: z.union([image(), z.string().url()]).optional(), diff --git a/src/write/WritePortal.tsx b/src/write/WritePortal.tsx index b3074d6..91d398a 100644 --- a/src/write/WritePortal.tsx +++ b/src/write/WritePortal.tsx @@ -105,6 +105,7 @@ function emptyMeta(): PostMeta { tags: [], slug: '', coverFileName: '', + proposedTopic: '', }; } diff --git a/src/write/meta/MetaForm.tsx b/src/write/meta/MetaForm.tsx index fb3f952..bf7cf3a 100644 --- a/src/write/meta/MetaForm.tsx +++ b/src/write/meta/MetaForm.tsx @@ -16,6 +16,7 @@ type Props = { export function MetaForm({ authors, topics, meta, images, onChange }: Props) { const [slugTouched, setSlugTouched] = useState(false); const [tagInput, setTagInput] = useState(''); + const [proposing, setProposing] = useState(!!meta.proposedTopic); const set = (patch: Partial) => onChange({ ...meta, ...patch }); @@ -98,10 +99,15 @@ export function MetaForm({ authors, topics, meta, images, onChange }: Props) { + {proposing && ( +
+ + +
+ )} +