Skip to content

chore: more customizing#817

Open
avivkeller wants to merge 1 commit into
mainfrom
custom
Open

chore: more customizing#817
avivkeller wants to merge 1 commit into
mainfrom
custom

Conversation

@avivkeller
Copy link
Copy Markdown
Member

Adds more customizability into the web generator, with custom templating and lightningcss options

@avivkeller avivkeller requested a review from a team as a code owner June 1, 2026 16:58
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

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

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jun 1, 2026 4:59pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 1, 2026

PR Summary

Low Risk
Build-time HTML/CSS customization with Node.js-preserving defaults; raw head.html is an intentional escape hatch for trusted config only.

Overview
The web generator gains two configuration hooks so non–Node.js projects can brand docs and tune CSS compilation without forking the HTML template.

head replaces hardcoded favicon/description/OG tags in template.html with a ${head} placeholder. Build time renders meta, links, and optional raw html arrays via buildHead (attribute bags, boolean valueless attrs, repeated tags). Node.js defaults live in defaultConfiguration.head; overriding head drops those defaults. og:title, og:type, and font links stay in the template.

lightningcss is spread into every bundleAsync call in the CSS Rolldown plugin (visitors, customAtRules, etc.); generator-owned fields still win. head and lightningcss are omitted from the #theme/config virtual module so build-only / non-serializable values never reach client bundles.

README documents both options; unit and integration tests cover buildHead and end-to-end HTML output.

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

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 55c78ba. Configure here.

const renderTag = (tag, attrs) => {
const rendered = Object.entries(attrs)
.filter(([, value]) => value != null && value !== false)
.map(([key, value]) => (value === true ? ` ${key}` : ` ${key}="${value}"`))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attribute values not HTML-escaped in renderTag

Medium Severity

renderTag interpolates attribute values directly into double-quoted HTML attributes without escaping special characters. A content value containing a double quote (e.g. a project description like The "best" toolkit) produces malformed HTML (content="The "best" toolkit"), breaking the tag and potentially causing the downstream HTML minifier to error or emit garbled output. Ampersands in URLs with query parameters (?a=1&b=2) are also technically invalid. Values need at least "" and && encoding.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 55c78ba. Configure here.

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.

1 participant