Skip to content

Commit 827ba0f

Browse files
committed
feat: enhance thumbnail description
1 parent 9cd4904 commit 827ba0f

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

apps/blog/src/content.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const posts = defineCollection({
66
schema: z.object({
77
title: z.string(),
88
description: z.string(),
9+
short_description: z.string().optional(),
910
date: z.coerce.date(),
1011
tags: z.array(z.string()).default([]),
1112
cover: z.string().optional(),

apps/blog/src/content/posts/en/introducing-explainer-v2.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Introducing Explainer v2
3-
description: Explainer v2 is a monorepo documentation boilerplate built with Astro, React, and Tailwind CSS 4 — giving you docs, blog, and website apps ready to go with multi-project support, versioning, i18n, and more.
3+
description: Explainer v2 is a monorepo documentation boilerplate built with Astro, React, and Tailwind — giving you docs, blog, and website apps ready to go with multi-project support, versioning, i18n, and more.
4+
short_description: "A monorepo documentation boilerplate with Astro, React, and Tailwind."
45
date: 2026-03-10
56
tags: [announcement, release, documentation, open-source]
67
status: published

apps/blog/src/content/posts/fr/introducing-explainer-v2.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Présentation d'Explainer v2
3-
description: Explainer v2 est un boilerplate de documentation monorepo construit avec Astro, React et Tailwind CSS 4 — offrant des apps docs, blog et site web prêtes à l'emploi avec support multi-projet, versioning, i18n, et plus encore.
3+
description: Explainer v2 est un boilerplate de documentation monorepo construit avec Astro, React et Tailwind — offrant des apps docs, blog et site web prêtes à l'emploi avec support multi-projet, versioning, i18n, et plus encore.
4+
short_description: "Explainer v2 est un boilerplate de documentation monorepo construit avec Astro, React et Tailwind."
45
date: 2026-03-10
56
tags: [announcement, release, documentation, open-source]
67
status: published

apps/blog/src/pages/[locale]/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const t = useTranslations(locale)
4545
<div data-tags={JSON.stringify(post.data.tags)} data-title={post.data.title} data-description={post.data.description ?? ''}>
4646
<PostCard
4747
title={post.data.title}
48-
description={post.data.description}
48+
description={post.data.short_description ?? post.data.description}
4949
date={post.data.date}
5050
tags={post.data.tags}
5151
cover={post.data.cover ?? `${getPostHref(post)}/thumbnail.png`}

apps/docs/src/components/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Navbar, LocaleSwitcher, getAppLinks, cn } from '@explainer/ui'
1+
import { LocaleSwitcher, Navbar, getAppLinks } from '@explainer/ui'
22
import type { NavItem, ProjectInfo } from '../lib/docs'
33
import { MobileMenu } from './mobile-menu'
44
import { ProjectTabs } from './project-tabs'
@@ -39,7 +39,7 @@ export function Header({
3939
const appLinks = getAppLinks('docs', appUrlOverrides)
4040

4141
return (
42-
<div className="sticky top-0 z-50 w-full bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
42+
<div className="sticky top-0 z-50 w-full bg-background/95 backdrop-blur `supports-backdrop-filter:bg-background/60">
4343
<Navbar
4444
brand={title}
4545
brandHref="/"

packages/thumbnail/src/integration.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface ContentEntry {
2020
filePath: string
2121
title: string
2222
description?: string
23+
shortDescription?: string
2324
/** URL pathname this entry maps to (without leading slash) */
2425
urlPath: string
2526
}
@@ -52,6 +53,7 @@ async function buildContentIndex(
5253
filePath,
5354
title: data.title ?? urlPath.split('/').pop() ?? '',
5455
description: data.description,
56+
shortDescription: data.short_description,
5557
urlPath,
5658
}
5759

@@ -238,7 +240,7 @@ function resolveFromIndex(
238240
return {
239241
headline: appName,
240242
title: direct.title,
241-
description: direct.description,
243+
description: direct.shortDescription ?? direct.description,
242244
}
243245
}
244246

@@ -260,7 +262,7 @@ function resolveFromIndex(
260262
return {
261263
headline: appName,
262264
title: entry.title,
263-
description: entry.description,
265+
description: entry.shortDescription ?? entry.description,
264266
}
265267
}
266268
}
@@ -274,7 +276,7 @@ function resolveFromIndex(
274276
return {
275277
headline: appName,
276278
title: entry.title,
277-
description: entry.description,
279+
description: entry.shortDescription ?? entry.description,
278280
}
279281
}
280282
}

0 commit comments

Comments
 (0)