Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
33c10e7
docs: rewrite and restructure the documentation
ovflowd Oct 27, 2026
3261124
feat(www): redesign doc-kit.nodejs.org
ovflowd Oct 27, 2026
a404412
fix(react): replay the press that hydrates an island
ovflowd Oct 27, 2026
7a853ec
refactor(www): skip comments instead of stripping them when inlining …
ovflowd Oct 27, 2026
0bdd6bb
refactor(react): keep the press events with the other UI constants
ovflowd Oct 27, 2026
6835ddf
chore(www): make the site its own workspace package
ovflowd Oct 27, 2026
4c571b6
chore(www): add the source of the social preview image
ovflowd Oct 27, 2026
b76d1bc
feat(www): make the benchmarks reproducible
ovflowd Oct 27, 2026
b7992df
docs: give every generator its own page again
ovflowd Oct 27, 2026
42d666a
feat(www): write the home page in MDX on doc-kit's own code blocks
ovflowd Oct 27, 2026
32fef69
docs: link to one place instead of repeating it
ovflowd Oct 29, 2026
16c9eda
fix(react): scope the heading layout and mark the selected code tab
ovflowd Oct 29, 2026
965c875
refactor(www): drop the workarounds doc-kit no longer needs
ovflowd Oct 29, 2026
cc27b62
feat(www): build the all page and take more from the configuration
ovflowd Oct 29, 2026
81e70af
docs(react): shorten the comment on held presses
ovflowd Oct 29, 2026
a2ff6b2
refactor: move the benchmark to scripts/ and slim it down
ovflowd Oct 29, 2026
22bce64
docs: make the diagrams self-contained and play them once
ovflowd Oct 29, 2026
ea0b9f9
feat(www): draw the home page's animations as SVGs
ovflowd Oct 29, 2026
22c3b2c
refactor(www): keep the home page's main landmark on a div
ovflowd Oct 29, 2026
b968eab
feat(www): polish Kit's head
ovflowd Oct 29, 2026
607ac4e
chore(www): format the social card's source
ovflowd Oct 29, 2026
70fc4db
fix(www): bring back the site and search previews
ovflowd Oct 29, 2026
0bf2a4e
docs: format the guides with oxfmt 0.74
ovflowd Nov 6, 2026
a713a85
fix(react): replay the press that starts an island loading
ovflowd Nov 6, 2026
caa2360
docs: measure the benchmarks again now that #1179 has landed
ovflowd Nov 6, 2026
66d05c4
test: add versioned pageURL tests for canonical function
bmuenzenmeyer Nov 7, 2026
e487647
fix(react): link the release line and the index's directory as canonical
ovflowd Nov 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(www): write the home page in MDX on doc-kit's own code blocks
The home page's words and code samples now live in `www/pages/index.mdx`
instead of a JSX component, so they're edited like any other page. Its
code samples are fenced blocks, highlighted by doc-kit and shown in its
own code boxes and tabs, with their copy buttons, which replaces the
theme's own highlighter, copy button, code box, install tabs and output
tabs. What MDX can't express stays in thin components: the two canvas
animations, the sections' layout, and the hand-drawn previews and card
art.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
ovflowd committed Nov 17, 2026
commit 42d666a2115f3832757eb998cb401981ee482a96
6 changes: 3 additions & 3 deletions docs/customization.md
Comment thread
ovflowd marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,11 @@ uses most of this page:
[home page](https://github.com/nodejs/doc-kit/blob/main/www/pages/index.mdx),
a 404 page, and doc-kit's layout for everything else.
- A logo and a footer of its own.
- Islands for the home page's animations and tabs, listed in `components`.
- Islands for the home page's two animations, and the sections the page is
laid out with, all listed in `components`.
- A stylesheet that swaps the typeface for Inter and keeps doc-kit's neutral
palette, and a template that preloads Inter instead of Open Sans.
- A `#theme/site` virtual module with doc-kit's version, for the footer, and
the JSON schema's, for the home page.
- A `#theme/site` virtual module with doc-kit's version, for the footer.
- A rehype plugin that inlines the diagrams, and `pathsToCopy` for its public
files, fonts and JSON schemas.

Expand Down
74 changes: 57 additions & 17 deletions www/doc-kit.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,70 @@ const guideItems = [
{ label: 'Creating generators', link: '/creating-generators' },
];

// Components the pages and the theme render. The ones that hydrate on the
// client must be listed here for doc-kit to register their islands.
const COMPONENTS = {
Home: 'home/Home.jsx',
// The home page's animations. They hydrate on the client, so they must be
// listed in `components` for doc-kit to register their islands.
const ISLANDS = {
HeroFlow: 'components/HeroFlow.jsx',
PipelineFlow: 'components/PipelineFlow.jsx',
InstallTabs: 'components/InstallTabs.jsx',
OutputTabs: 'components/OutputTabs.jsx',
CopyCode: 'components/CopyCode.jsx',
};

const componentAliases = Object.fromEntries(
Object.entries(COMPONENTS).map(([name, file]) => [
`#theme/${name}`,
join(THEME, file),
])
);
// The components `www/pages/index.mdx` lays out its sections with, by the
// module exporting them
const HOME = {
'home/sections.jsx': [
Comment thread
ovflowd marked this conversation as resolved.
Resolved
'Hero',
'Actions',
'Button',
'UsedBy',
'Stats',
'Stat',
'Fact',
'Section',
'Performance',
'Formats',
'Features',
'Feature',
'Steps',
'Step',
'Closing',
],
'home/previews.jsx': ['SitePreview', 'SearchPreview'],
};

const components = Object.fromEntries(
Object.keys(COMPONENTS).map(name => [name, `#theme/${name}`])
);
const componentAliases = {
...Object.fromEntries(
Object.entries(ISLANDS).map(([name, file]) => [
`#theme/${name}`,
join(THEME, file),
])
),
...Object.fromEntries(
Object.keys(HOME).map(file => [
`#theme/${file.replace(/\.jsx$/, '')}`,
join(THEME, file),
])
),
};

const components = {
...Object.fromEntries(
Object.keys(ISLANDS).map(name => [name, `#theme/${name}`])
),
...Object.fromEntries(
Object.entries(HOME).flatMap(([file, names]) =>
names.map(name => [
name,
{
source: `#theme/${file.replace(/\.jsx$/, '')}`,
isDefaultExport: false,
},
])
)
),
};

// Build-time facts for the theme, as the `#theme/site` module
const site = { version, schemaVersion: SCHEMA_VERSION };
const site = { version };

const INTER = dirname(
require.resolve('@fontsource-variable/inter/package.json')
Expand Down
Loading