Skip to content

feat(404): add customizable not found page text and link options#878

Closed
bmuenzenmeyer wants to merge 2 commits into
mainfrom
custom-404
Closed

feat(404): add customizable not found page text and link options#878
bmuenzenmeyer wants to merge 2 commits into
mainfrom
custom-404

Conversation

@bmuenzenmeyer

@bmuenzenmeyer bmuenzenmeyer commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Considered how to quickly customize the 404 text. This was chosen over a larger scale - user provided 404 page.
Responsible AI disclosure: authored in partnership with Claude Code and hand-reviewed by an organic human.

This was useful for me to continue to catch up on how doc-kit has evolved while I have been spread thin.

Validation

Unit tests

Related Issues

closes #877

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@bmuenzenmeyer bmuenzenmeyer requested a review from a team as a code owner July 2, 2026 15:21
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 2, 2026 3:26pm

Request Review

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped to synthetic 404 MDAST content in doc generation; defaults match prior hardcoded copy so existing builds behave the same.

Overview
Adds notFoundText, notFoundLinkUrl, and notFoundLinkText to the jsx-ast generator so the synthetic 404.html message and “return to” link can be overridden without supplying a full custom page.

Defaults live in NOT_FOUND_DEFAULTS (spread into defaultConfiguration), buildNotFoundPage now accepts config with the same fallbacks, and generate.mjs passes the full jsx-ast config when building the not-found descriptor. Types and the generator README document the new options; a unit test asserts custom values flow into the MDAST paragraph and link.

Reviewed by Cursor Bugbot for commit 535fb73. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.03%. Comparing base (a43c90f) to head (535fb73).

Files with missing lines Patch % Lines
src/generators/jsx-ast/generate.mjs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
+ Coverage   84.99%   85.03%   +0.03%     
==========================================
  Files         179      179              
  Lines       16407    16447      +40     
  Branches     1483     1486       +3     
==========================================
+ Hits        13945    13985      +40     
  Misses       2452     2452              
  Partials       10       10              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

api-links Generator

apilinks.json
Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines

  {
    'Agent.defaultMaxSockets': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L291',
    'Buffer.alloc': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L433',
    'Buffer.allocUnsafe': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L447',
    'Buffer.allocUnsafeSlow': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L459',
...
    'agent.addRequest': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L356',
+   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L326',
-   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L295',
    'agent.createSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L427',
    'agent.destroy': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L660',
+   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L484',
-   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L325',
    'agent.keepSocketAlive': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L616',
    'agent.removeSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L555',
    'agent.reuseSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L652',
    'assert.assert': 'https://github.com/nodejs/node/blob/HEAD/lib/assert.js#L185',
    'asyncResource.asyncId': 'https://github.com/nodejs/node/blob/HEAD/lib/async_hooks.js#L243',
...
    'server.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2463',
+   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2596',
+   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L120',
+   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L122',
-   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L671',
-   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L681',
-   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L693',
    'server.getConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2558',
    'server.listen': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2265',
    'server.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2701',
+   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L124',
-   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L709',
    'server.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2710',
+   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2636',
+   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2665',
-   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L677',
-   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L716',
    'serverresponse._finish': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L246',
    'serverresponse._implicitHeader': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L403',
    'serverresponse.assignSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L296',
    'serverresponse.detachSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L307',
    'serverresponse.statusCode': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L269',
...
    'socket.addSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1043',
+   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L860',
-   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L932',
    'socket.bind': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L284',
    'socket.bindSync': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L437',
    'socket.close': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L895',
+   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1427',
-   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L481',
    'socket.connectSync': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L514',
    'socket.destroySoon': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1002',
    'socket.disconnect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L607',
    'socket.dropMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1028',
    'socket.dropSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1061',
...
    'socket.read': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L985',
+   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1778',
-   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1118',
    'socket.remoteAddress': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L944',
    'socket.resetAndDestroy': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L947',
    'socket.resume': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L976',
    'socket.send': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L732',
    'socket.sendto': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L621',
...
    'socket.setTypeOfService': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L807',
+   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1792',
-   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1128',
    'socket[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L919',
    'socket[kAfterAsyncWrite]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1136',
    'socket[kReinitializeHandle]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1495',
    'string_decoder.StringDecoder': 'https://github.com/nodejs/node/blob/HEAD/lib/string_decoder.js#L60',
    'timers.clearImmediate': 'https://github.com/nodejs/node/blob/HEAD/lib/timers.js#L226',

web Generator

File Base Head Diff
all.html 19.84 MB 19.84 MB -6.00 B (-0.00%)

@avivkeller

Copy link
Copy Markdown
Member

We already support this functionally, albeit in a different way.

By adding a 404.md file, consumers can set their own 404 page.

@bmuenzenmeyer

Copy link
Copy Markdown
Contributor Author

perfect - no harm at all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config: add customization of 404 page

2 participants