Skip to content

Commit a43c90f

Browse files
authored
feat(title): allow no-md title (#854)
1 parent 8851110 commit a43c90f

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@node-core/doc-kit",
33
"type": "module",
4-
"version": "1.4.0",
4+
"version": "1.4.1",
55
"repository": {
66
"type": "git",
77
"url": "git+https://github.com/nodejs/doc-kit.git"

src/generators/web/utils/processing.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,14 @@ export async function processBundles({
193193
const results = await Promise.all(
194194
datas.map(async data => {
195195
const root = resolvePageRoot(data);
196+
const title = data.title ?? data.heading.data.name;
196197

197198
// Replace template placeholders with actual content
198199
const renderedHtml = populateWithEvaluation(template, {
199-
title: data.heading.data.name
200-
? `${data.heading.data.name} | ${titleSuffix}`
200+
title: title
201+
? titleSuffix
202+
? `${title} | ${titleSuffix}`
203+
: title
201204
: titleSuffix,
202205
dehydrated: serverBundle.pages.get(`${data.api}.js`) ?? '',
203206
importMap: clientBundle.importMap?.replaceAll('/', root) ?? '',

0 commit comments

Comments
 (0)