update dependencies and devDependencies
[squeep-html-template-helper] / README.md
1 # @squeep/html-template-helper
2
3 Simplistic helpers for rendering HTML and boilerplate.
4
5 Specific to Squeep Framework Applications, this module has strong opinions and makes many assumptions.
6
7 ## API
8
9 `htmlPage(pagePathLevel, ctx, options, main = [])`
10
11 ### Context
12
13 The context is referenced for authenticated user information, as well as messaging.
14
15 - `ctx.session.authenticatedIdentifier`
16 - `ctx.session.authenticatedProfile`
17
18 If either of these are present, a navigation link is added to the page header allowing the user to log out.
19 The link will point relatively to `/admin/logout`.
20
21 - `ctx.url`
22
23 If present, added as a query parameter (`r`, for redirect) to the logout link.
24
25 - `ctx.errors`
26 - `ctx.notifications`
27
28 Lists of errors and notices to show at top of page, before main content.
29
30 ### Options
31
32 - `options.pageTitle` - title and h1
33 - `options.headElements` - list of items added to <head>
34 - `options.bodyAttributes` - object entries get mapped to k="v", included on body element
35 - `options.logoUrl` - appears beside h1 if set
36 - `options.footerEntries` - array of content at bottom of page
37 - `options.navLink` - array of {href, text, class} included in page header
38 - `options.errorHeading` - h2 for error section
39 - `options.errorContent` - additional information included ahead of list of errors
40 - `options.notificationHeading` - h2 for notice section
41 - `options.notificationContent` - additional information included ahead of list of notices
42 - `options.`