You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since <!DOCTYPE html> is not valid JSX, but must be included in .html documents for best practices, I suggest adding a feature to automatically add <!DOCTYPE html>, to the JSX plugins. Some more info on stackoverflow.
This can be implemented easily with the snippet taken from the source code of the lume showcase website fabon.info:
/** Register the plugin to support JSX and TSX files */exportdefaultfunction(userOptions?: Partial<Options>) {constoptions=merge(defaults,userOptions);constextensions=Array.isArray(options.extensions)
? {pages: options.extensions,components: options.extensions}
: options.extensions;return(site: Site)=>{const engine =newPreactJsxEngine();site.loadPages(extensions.pages,loader,engine);site.loadComponents(extensions.components,loader,engine);site.process([".html"],addDoctype)functionaddDoctype(page: Page){if(!page.content?.toString().trim().startsWith("<!DOCTYPE")){page.content=`<!DOCTYPE html>${page.content}`;}}};}
@oscarotero if this is cool for you, let me know and I will create a PR for the JSX plugins.
The text was updated successfully, but these errors were encountered:
Since
<!DOCTYPE html>
is not valid JSX, but must be included in.html
documents for best practices, I suggest adding a feature to automatically add<!DOCTYPE html>
, to the JSX plugins. Some more info on stackoverflow.This can be implemented easily with the snippet taken from the source code of the lume showcase website fabon.info:
@oscarotero if this is cool for you, let me know and I will create a PR for the JSX plugins.
The text was updated successfully, but these errors were encountered: