fix: parse featured field from display.featured in collections

The collection YAML files have featured nested under display object,
not at the top level. Updated generate-website-data.mjs to check both
data.featured and data.display?.featured.
This commit is contained in:
Aaron Powell
2026-01-28 16:56:41 +11:00
parent fbb92dc8aa
commit f76f63866a
4 changed files with 208 additions and 205 deletions

View File

@@ -400,12 +400,15 @@ function generateCollectionsData() {
const tags = data.tags || [];
tags.forEach((t) => allTags.add(t));
// featured can be at top level or nested under display
const featured = data.featured || data.display?.featured || false;
collections.push({
id: file.replace(".collection.yml", ""),
name: data.name || file.replace(".collection.yml", ""),
description: data.description || "",
tags: tags,
featured: data.featured || false,
featured: featured,
items: (data.items || []).map((item) => ({
path: item.path,
kind: item.kind,