diff --git a/apps/frontend/src/api/wiki.api.ts b/apps/frontend/src/api/wiki.api.ts index c91e806..fbfcb47 100644 --- a/apps/frontend/src/api/wiki.api.ts +++ b/apps/frontend/src/api/wiki.api.ts @@ -16,8 +16,13 @@ interface RawWikiPage { createdAt: string locale: string repo?: string | null + tags?: string[] } +// The engines page lists the flagship engines only; the wiki marks those with +// a `highlighted` tag next to `engine`. +const HIGHLIGHTED_TAG = 'highlighted' + async function fetchPages( tag: string, opts: { body?: boolean; limit?: number } = {}, @@ -70,17 +75,19 @@ const getBlogPage = async (slug: string): Promise => { const listEnginePages = async (): Promise => { const pages = await fetchPages('engine', { body: true }) - return pages.map((p): WikiPageWithContent => ({ - id: p.id, - path: p.path, - title: p.title || p.path, - description: p.description ?? '', - content: p.content ?? '', - updatedAt: p.updatedAt, - createdAt: p.createdAt, - locale: p.locale, - repo: p.repo ?? null, - })) + return pages + .filter((p) => (p.tags ?? []).includes(HIGHLIGHTED_TAG)) + .map((p): WikiPageWithContent => ({ + id: p.id, + path: p.path, + title: p.title || p.path, + description: p.description ?? '', + content: p.content ?? '', + updatedAt: p.updatedAt, + createdAt: p.createdAt, + locale: p.locale, + repo: p.repo ?? null, + })) } const listHowtoPages = async (): Promise => {