Response.sendPage
Response.sendPage($pageMap)
Description
Send a complete HTML5 document, with header fields, HTML body, and asset links.
Takes a Map of:
{ title: Document title description: Document description body: HTML body bodyClass: class attribute of `body` tag css: CSS assets (see below) js: JS assets (see below) icon: Path to favicon image image: Image to show when shared on social sites }
Example:
Response.sendPage({ title: 'My Web Page', description: 'A very interesting page.', css: url'/assets/main.css', js: [ url'http://cdnjs.net/library.min.js', url'/assets/js' ], body: bodyHtml(), }); template bodyHtml() { <h1>My Web Page</h1> <p>Interesting content...</p> }
Assets
CSS or JS assets can be a single element or a List.
An asset can be:
- TypeString (css or js) - inlined in the document
- URL - to be included
They are positioned according to performance best practices: CSS is included in the
, and JS is included at the bottom of the page.