mergeMeta()function
mergeMeta(meta1: Meta, meta2: PossibleMeta, caller: AnyCaller = mergeMeta): Meta
| Param | Type | |
|---|---|---|
meta1 | Meta | The existing fully-resolved Meta to merge into. required |
.root | ImmutableURL | |
.url | ImmutableURL | URL of the current page (used to update history API and as the initial URL for routing). readonly |
.app | string | Title of the entire application. readonly |
.title | string | |
.description | string | Description of the current page. readonly |
.image | string | readonly |
.language | string | Language code (used for lang tag in HTML). readonly |
.csp | MetaCSP | Type for a meta Content-Security-Policy tag in { resource: string[] } format. readonly |
.tags | MetaTags | Set of named meta <meta /> tags in { name: content } format. readonly |
.links | MetaLinks | Set of resolved meta <link /> tags in { rel: href } format (hrefs already absolutified to ImmutableURI). readonly |
.modules | MetaAssets | Set of resolved linked assets in (href)[] format (hrefs already absolutified to ImmutableURI). readonly |
.scripts | MetaAssets | Set of resolved linked assets in (href)[] format (hrefs already absolutified to ImmutableURI). readonly |
.stylesheets | MetaAssets | Set of resolved linked assets in (href)[] format (hrefs already absolutified to ImmutableURI). readonly |
meta2 | PossibleMeta | The new PossibleMeta to apply on top. required |
.root | PossibleURL | |
.url | PossibleURI | |
.params | PossibleURIParams | Set the params in the URL (not merged with existing params). - Added to url after it is resolved.- Baseically readonly |
.links | PossibleMetaLinks | Set of input meta <link /> tags in { rel: href } format, before hrefs are resolved. readonly |
.modules | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
.scripts | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
.stylesheets | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
caller | AnyCaller |
Merge a PossibleMeta onto an existing Meta, resolving URLs and assets in the process.
titleis merged withjoinTitles().urlis resolved to an absolute URL, e.g../d/e/f+/a/b/cbecomeshttps://d.com/a/b/c/d/e/fstylesheetsandlinkshrefs newly set inmeta2are absolutified against the mergedurl/root, so they stay correct no matter where they are later rendered.
Examples
mergeMeta(currentMeta, { title: "Messages", url: "./messages" })