@antora/content-classifier 3.0.0-alpha.9 → 3.0.0-beta.1

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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The Content Classifier is a component in Antora responsible for organizing aggregated content into a virtual file catalog for use in an Antora documentation pipeline.
4
4
 
5
5
  [Antora](https://antora.org) is a modular static site generator designed for creating documentation sites from AsciiDoc documents.
6
- Its site generator pipeline aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
6
+ Its site generator aggregates documents from versioned content repositories and processes them using [Asciidoctor](https://asciidoctor.org).
7
7
 
8
8
  ## Copyright and License
9
9
 
@@ -169,11 +169,11 @@ class ContentCatalog {
169
169
  ('/' + src.relative).indexOf('/_') < 0
170
170
  ) {
171
171
  publishable = true
172
- versionSegment = computeVersionSegment.bind(this)(src.component, src.version)
172
+ versionSegment = computeVersionSegment.call(this, src.component, src.version)
173
173
  file.out = computeOut(src, family, versionSegment, this.htmlUrlExtensionStyle)
174
174
  }
175
175
  if (!file.pub && (publishable || family === 'nav')) {
176
- if (versionSegment == null) versionSegment = computeVersionSegment.bind(this)(src.component, src.version)
176
+ if (versionSegment == null) versionSegment = computeVersionSegment.call(this, src.component, src.version)
177
177
  file.pub = computePub(src, file.out, family, versionSegment, this.htmlUrlExtensionStyle)
178
178
  }
179
179
  filesForFamily.set(key, file)
@@ -289,7 +289,7 @@ class ContentCatalog {
289
289
  componentVersion.url = startPage.pub.url
290
290
  } else {
291
291
  // QUESTION: should we warn if the default start page cannot be found?
292
- const versionSegment = computeVersionSegment.bind(this)(name, version)
292
+ const versionSegment = computeVersionSegment.call(this, name, version)
293
293
  componentVersion.url = computePub(
294
294
  (startPageSrc = prepareSrc(Object.assign({}, indexPageId, { family: 'page' }))),
295
295
  computeOut(startPageSrc, startPageSrc.family, versionSegment, this.htmlUrlExtensionStyle),
@@ -302,7 +302,7 @@ class ContentCatalog {
302
302
  const symbolicVersionAlias = createSymbolicVersionAlias(
303
303
  name,
304
304
  version,
305
- computeVersionSegment.bind(this)(name, version, 'alias'),
305
+ computeVersionSegment.call(this, name, version, 'alias'),
306
306
  this.latestVersionUrlSegmentStrategy
307
307
  )
308
308
  if (symbolicVersionAlias) this.addFile(symbolicVersionAlias)
@@ -56,9 +56,16 @@ function parseResourceId (spec, ctx = {}, defaultFamily = 'page', permittedFamil
56
56
  }
57
57
 
58
58
  if (~relative.indexOf('/')) {
59
- relative = relative
60
- .split('/')
61
- .filter((it) => it && it !== '.' && it !== '..')
59
+ const relativeSegments = relative.split('/')
60
+ let from
61
+ if (relativeSegments[0] === '.' && (from = ctx.relative)) {
62
+ relativeSegments[0] = from.substr(0, (from.lastIndexOf('/') + 1 || 1) - 1)
63
+ }
64
+ relative = relativeSegments
65
+ .reduce((accum, segment) => {
66
+ segment === '..' ? accum.pop() : (segment || '.') !== '.' && accum.push(segment)
67
+ return accum
68
+ }, [])
62
69
  .join('/')
63
70
  }
64
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/content-classifier",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.0-beta.1",
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)",
@@ -16,12 +16,12 @@
16
16
  },
17
17
  "main": "lib/index.js",
18
18
  "dependencies": {
19
- "@antora/logger": "3.0.0-alpha.9",
19
+ "@antora/logger": "3.0.0-beta.1",
20
20
  "mime-types": "~2.1",
21
21
  "vinyl": "~2.2"
22
22
  },
23
23
  "engines": {
24
- "node": ">=10.17.0"
24
+ "node": ">=12.21.0"
25
25
  },
26
26
  "files": [
27
27
  "lib/"
@@ -34,5 +34,5 @@
34
34
  "static site",
35
35
  "web publishing"
36
36
  ],
37
- "gitHead": "a504d6889819b548e8a5416a7194cbb6f9a93e93"
37
+ "gitHead": "7c5ef1ea93dd489af533c80a936c736013c41769"
38
38
  }