Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/page-composer

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/page-composer - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0-beta.5

25

lib/build-ui-model.js

@@ -66,20 +66,20 @@ 'use strict'

const src = file.src
if (src.stem === '404' && !src.component) return { layout: '404', title: file.title }
const { component: component_, version, module: module_, relative: relativeSrcPath, origin, editUrl, fileUri } = src
// QUESTION should attributes be scoped to AsciiDoc, or should this work regardless of markup language? file.data?
const asciidoc = file.asciidoc || {}
const attributes = asciidoc.attributes || {}
const pageAttributes = Object.entries(attributes).reduce((accum, [name, val]) => {
if (name.startsWith('page-')) accum[name.substr(5)] = val
return accum
}, {})
const pageAttributes = {}
Object.entries(attributes).forEach(([name, val]) => {
if (name.startsWith('page-')) pageAttributes[name.substr(5)] = val
})
if (src.stem === '404' && !('component' in src)) {
return { 404: true, attributes: pageAttributes, layout: '404', title: file.title }
}
const url = file.pub.url
const { component: component_, version, module: module_, relative: relativeSrcPath, origin, editUrl, fileUri } = src
const component = contentCatalog.getComponent(component_)
const componentVersion = contentCatalog.getComponentVersion(component, version)
const title = file.title || asciidoc.doctitle
const url = file.pub.url
// QUESTION can we cache versions on file.rel so only computed once per page version lineage?
const versions = component.versions.length > 1 ? getPageVersions(file, component, contentCatalog) : undefined
const title = file.title || asciidoc.doctitle
const model = {

@@ -105,7 +105,5 @@ contents: file.contents,

fileUri,
home: url === siteUiModel.homeUrl,
}
if (url === siteUiModel.homeUrl) model.home = true
if (navigationCatalog) attachNavProperties(model, url, title, navigationCatalog.getNavigation(component_, version))
if (versions) {

@@ -118,3 +116,2 @@ Object.defineProperty(model, 'latest', {

}
// NOTE site URL has already been normalized at this point

@@ -121,0 +118,0 @@ const siteUrl = siteUiModel.url

@@ -45,3 +45,14 @@ 'use strict'

)
return createPageComposerInternal(buildBaseUiModel(playbook, contentCatalog), layouts)
const composePage = createPageComposerInternal(buildBaseUiModel(playbook, contentCatalog), layouts)
const create404Page = (siteAsciiDocConfig) => {
return composePage({
asciidoc: siteAsciiDocConfig,
mediaType: 'text/html',
out: { path: '404.html' },
pub: {},
src: { stem: '404' },
title: (siteAsciiDocConfig && siteAsciiDocConfig.attributes['404-page-title']) || 'Page Not Found',
})
}
return Object.assign(composePage, { composePage, create404Page })
}

@@ -48,0 +59,0 @@

{
"name": "@antora/page-composer",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"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.",

@@ -18,3 +18,3 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/logger": "3.0.0-beta.4",
"@antora/logger": "3.0.0-beta.5",
"handlebars": "~4.7",

@@ -38,4 +38,3 @@ "require-from-string": "~2.0"

],
"gitHead": "8a142499e9f1a9e0631777796e06dd6c010d3a90",
"readmeFilename": "README.md"
"gitHead": "a13d03df41654d4deb78211a5a54953ce2a35fb8"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc