Skip to content

Commit 9f98edf

Browse files
committed
fix title
1 parent 38cee37 commit 9f98edf

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

scripts/vercel-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ node bin/cli.mjs generate \
3030
--index "./node/doc/api/index.md" \
3131
--skip-lint
3232

33-
echo "Deleting Cloned node folder"
33+
echo "Deleting ./node"
3434
rm -rf node/

scripts/vercel-prepare.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# clones the node source repository
1+
# Clone nodejs/node to ./node
22
git clone https://github.com/nodejs/node.git --depth 1 node
33

4-
# installs npm dependencies
4+
# Install npm dependencies
55
npm ci
66

7-
# creates the output directory
7+
# Create the ./out directory
88
mkdir -p out

src/generators/web/index.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export async function executeServerCode(serverCode, require) {
3333
* @param {string} template - HTML template
3434
* @param {ReturnType<createASTBuilder>} astBuilders - AST builder functions
3535
* @param {ReturnType<createRequire>} require - Node.js require function
36+
* @param {import('semver').SemVer} version - The Node.js version
3637
* @param {string} output - Output directory path
3738
* @returns {Promise<{html: string, css?: string}>}
3839
*/
@@ -41,6 +42,7 @@ export async function processEntry(
4142
template,
4243
{ buildServerProgram, buildClientProgram },
4344
require,
45+
{ version },
4446
output
4547
) {
4648
const { value: code } = toJs(entry, { handlers: jsx });
@@ -58,7 +60,7 @@ export async function processEntry(
5860
Buffer.from(
5961
// TODO(@avivkeller): Don't depend on mustache
6062
Mustache.render(template, {
61-
title: entry.data.heading.data.name,
63+
title: `${entry.data.heading.data.name} | Node.js v${version} Documentation`,
6264
dehydrated,
6365
javascript: clientBundle.js,
6466
})
@@ -96,7 +98,7 @@ export default {
9698
* @param {import('../jsx-ast/utils/buildContent.mjs').JSXContent[]} entries
9799
* @param {Partial<GeneratorOptions>} options
98100
*/
99-
async generate(entries, { output }) {
101+
async generate(entries, { output, version }) {
100102
// Load template and set up dependencies
101103
const template = await readFile(
102104
new URL('template.html', import.meta.url),
@@ -109,7 +111,14 @@ export default {
109111
const results = [];
110112
for (const entry of entries) {
111113
results.push(
112-
await processEntry(entry, template, astBuilders, require, output)
114+
await processEntry(
115+
entry,
116+
template,
117+
astBuilders,
118+
require,
119+
version,
120+
output
121+
)
113122
);
114123
}
115124

0 commit comments

Comments
 (0)