@antora/page-composer
Advanced tools
Comparing version 2.0.1 to 2.1.0-rc.1
@@ -6,2 +6,3 @@ 'use strict' | ||
const requireFromString = require('require-from-string') | ||
const { URL } = require('url') | ||
@@ -89,2 +90,3 @@ const { DEFAULT_LAYOUT_NAME, HANDLEBARS_COMPILE_OPTIONS } = require('./constants') | ||
function buildUiModel (file, contentCatalog, navigationCatalog, site, env) { | ||
const siteRootPath = file.pub.rootPath || site.path || '' | ||
return { | ||
@@ -95,4 +97,4 @@ antoraVersion: VERSION, | ||
site, | ||
siteRootPath: file.pub.rootPath, | ||
uiRootPath: path.join(file.pub.rootPath, site.ui.url), | ||
siteRootPath, | ||
uiRootPath: siteRootPath + site.ui.url, | ||
} | ||
@@ -107,2 +109,3 @@ } | ||
if (siteUrl.charAt(siteUrl.length - 1) === '/') siteUrl = siteUrl.substr(0, siteUrl.length - 1) | ||
if ((model.path = new URL(siteUrl).pathname) === '/') model.path = '' | ||
model.url = siteUrl | ||
@@ -171,7 +174,9 @@ } | ||
} | ||
Object.defineProperty(model, 'latest', { | ||
get () { | ||
return this.versions && this.versions.find((candidate) => candidate.latest) | ||
}, | ||
}) | ||
if (versions) { | ||
Object.defineProperty(model, 'latest', { | ||
get () { | ||
return this.versions.find((candidate) => candidate.latest) | ||
}, | ||
}) | ||
} | ||
Object.assign(model, getNavContext(url, title, navigation)) | ||
@@ -178,0 +183,0 @@ |
{ | ||
"name": "@antora/page-composer", | ||
"version": "2.0.1", | ||
"version": "2.1.0-rc.1", | ||
"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", |
@@ -11,4 +11,4 @@ # Antora Page Composer | ||
Copyright (C) 2017-2018 [OpenDevise Inc.](https://opendevise.com) and the [Antora Project](https://antora.org). | ||
Copyright (C) 2017-2019 [OpenDevise Inc.](https://opendevise.com) and the [Antora Project](https://antora.org). | ||
Use of this software is granted under the terms of the [Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/) (MPL-2.0). |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12590
261
1