@antora/content-classifier 3.0.0-beta.2 → 3.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -268,8 +268,12 @@ class ContentCatalog {
268
268
  (startPageSrc = startPage.src).component === name &&
269
269
  startPageSrc.version === version
270
270
  ) {
271
- if ((startPageSrc.module !== 'ROOT' || startPageSrc.relative !== 'index.adoc') && !this.getById(indexPageId)) {
272
- this.addFile({ src: Object.assign({}, indexPageId, { family: 'alias' }), rel: startPage })
271
+ if (!this.getById(indexPageId)) {
272
+ const indexAliasId = Object.assign({}, ROOT_INDEX_ALIAS_ID, { component: name, version })
273
+ const indexAlias = this.getById(indexAliasId)
274
+ indexAlias
275
+ ? indexAlias.synthetic && Object.assign(indexAlias, { rel: startPage })
276
+ : this.addFile({ src: indexAliasId, rel: startPage, synthetic: true })
273
277
  }
274
278
  } else {
275
279
  // TODO pass componentVersion as logObject
@@ -312,7 +316,9 @@ class ContentCatalog {
312
316
  if (!startPageSpec) return
313
317
  const rel = this.resolvePage(startPageSpec)
314
318
  if (rel) {
315
- if (!(this.getSiteStartPage() || { synthetic: true }).synthetic) return
319
+ if (this.getById(ROOT_INDEX_PAGE_ID)) return
320
+ const indexAlias = this.getById(ROOT_INDEX_ALIAS_ID)
321
+ if (indexAlias) return indexAlias.synthetic ? Object.assign(indexAlias, { rel }) : undefined
316
322
  return this.addFile({ src: Object.assign({}, ROOT_INDEX_ALIAS_ID), rel, synthetic: true })
317
323
  } else if (rel === false) {
318
324
  logger.warn('Start page specified for site has invalid syntax: %s', startPageSpec)
@@ -565,15 +571,9 @@ function createSymbolicVersionAlias (component, version, symbolicVersionSegment,
565
571
  family
566
572
  ),
567
573
  }
568
- if (strategy === 'redirect:to') {
569
- originalVersionAlias.out = undefined
570
- originalVersionAlias.rel = symbolicVersionAlias
571
- return originalVersionAlias
572
- } else {
573
- symbolicVersionAlias.out = undefined
574
- symbolicVersionAlias.rel = originalVersionAlias
575
- return symbolicVersionAlias
576
- }
574
+ return strategy === 'redirect:to'
575
+ ? Object.assign(originalVersionAlias, { out: undefined, rel: symbolicVersionAlias })
576
+ : Object.assign(symbolicVersionAlias, { out: undefined, rel: originalVersionAlias })
577
577
  }
578
578
 
579
579
  function getFileLocation ({ path: path_, src: { abspath, origin } }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/content-classifier",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.6",
4
4
  "description": "Organizes aggregated content into a virtual file catalog for use in an Antora documentation pipeline.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -15,8 +15,11 @@
15
15
  "url": "https://gitlab.com/antora/antora/issues"
16
16
  },
17
17
  "main": "lib/index.js",
18
+ "scripts": {
19
+ "test": "_mocha"
20
+ },
18
21
  "dependencies": {
19
- "@antora/logger": "3.0.0-beta.2",
22
+ "@antora/logger": "3.0.0-beta.6",
20
23
  "mime-types": "~2.1",
21
24
  "vinyl": "~2.2"
22
25
  },
@@ -34,5 +37,5 @@
34
37
  "static site",
35
38
  "web publishing"
36
39
  ],
37
- "gitHead": "5cd3f9cc70622e465cb44daf1aa2035ed5a35f54"
40
+ "gitHead": "f9f747965f599442562f59206d870b7e38864806"
38
41
  }