-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the feature
The SWC html minifier removes the <head> and </body> closing tag attributes by default, as an optimization.
The following may be surprising, but it passes W3C validation, so SWC is technically right:
<!doctype html> <html lang=en> <meta name=generator content="Docusaurus v3.7.0"> <title>Docusaurus changelog | Docusaurus</title> <meta name=viewport content="width=device-width, initial-scale=1.0"> <body> blablaBut it turns out that despite being valid HTML, this can cause troubles, notably for LinkedIn social cards. Apparently, the LinkedIn crawler expects those tags to be present to be able to find the og:image meta tag, and maybe this affects other sites as well.
For Docusaurus, we'd like to have an option in SWC minimizer to disable this built-in optimization. @kdy1 suggested opening a feature request here.
Babel plugin or link to the feature description
No response
Additional context
See also related Docusaurus discussions: