@antora/page-composer
Advanced tools
Comparing version 2.3.0-alpha.1 to 2.3.0-alpha.2
@@ -30,2 +30,5 @@ 'use strict' | ||
function createPageComposer (playbook, contentCatalog, uiCatalog, env = process.env) { | ||
handlebars.registerHelper('resolvePage', resolvePageHelper) | ||
handlebars.registerHelper('resolvePageUrl', resolvePageUrlHelper) | ||
uiCatalog | ||
@@ -102,3 +105,3 @@ .findByType('helper') | ||
function buildSiteUiModel (playbook, contentCatalog) { | ||
const model = { title: playbook.site.title } | ||
const model = { title: playbook.site.title, contentCatalog: contentCatalog.exportToModel() } | ||
@@ -203,2 +206,11 @@ let siteUrl = playbook.site.url | ||
function resolvePageHelper (spec, { hash: context }) { | ||
return this.site.contentCatalog.resolvePage(spec, context) | ||
} | ||
function resolvePageUrlHelper (spec, { hash: context }) { | ||
const page = this.site.contentCatalog.resolvePage(spec, context) | ||
if (page) return page.pub.url | ||
} | ||
function getNavContext (url, title, navigation) { | ||
@@ -205,0 +217,0 @@ const navContext = { breadcrumbs: [] } |
{ | ||
"name": "@antora/page-composer", | ||
"version": "2.3.0-alpha.1", | ||
"version": "2.3.0-alpha.2", | ||
"description": "Wraps the embeddable HTML contents of each page file from the content catalog in a page layout to yield standalone pages in an Antora documentation pipeline.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13363
281