@baiyibai-antora/adf-extension 1.0.0-beta.1 → 1.0.0-beta.2

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.
@@ -110,8 +110,13 @@ module.exports = async function convertPages ({
110
110
  dirname: ospath.dirname(page.path),
111
111
  },
112
112
  contentCatalog,
113
- // Root-relative refs map directly onto the pub.url page index.
114
- Object.assign({}, asciidocConfig, { relativizeResourceRefs: false })
113
+ // Root-relative refs map directly onto the pub.url page index. The
114
+ // env-confluence attribute lets content branch per output
115
+ // (ifdef::env-confluence[]), mirroring Antora's env=site convention.
116
+ Object.assign({}, asciidocConfig, {
117
+ relativizeResourceRefs: false,
118
+ attributes: Object.assign({}, asciidocConfig.attributes, { 'env-confluence': '' }),
119
+ })
115
120
  )
116
121
 
117
122
  const attachments = []
@@ -263,8 +268,12 @@ async function finalizeManifest ({ playbook, contentCatalog, state, logger }) {
263
268
  for (const file of contentCatalog.getFiles()) {
264
269
  if (!file.src || file.src.family !== 'export' || !file.out || !file.contents) continue
265
270
  if (!included(file.src)) continue
266
- // Assembler exports carry their bytes as a lazy stream, not a Buffer.
271
+ // Assembler exports carry their bytes as a SINGLE-USE lazy stream. Buffer
272
+ // it and put the Buffer back on the file: Antora's site publisher writes
273
+ // this same file to the site's _exports directory after this hook, and a
274
+ // drained stream would leave a 0-byte download there.
267
275
  const contents = Buffer.isBuffer(file.contents) ? file.contents : await bufferStream(file.contents)
276
+ file.contents = contents
268
277
  // A generic "index.pdf" makes a poor download; qualify it.
269
278
  let filename = path.basename(file.out.path)
270
279
  if (filename.startsWith('index.')) filename = `${file.src.component}-${file.src.version}${filename.slice(5)}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baiyibai-antora/adf-extension",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "Antora extension that emits Confluence ADF JSON and a publish manifest for every page during a site build",
5
5
  "license": "MIT",
6
6
  "author": "baiyibai",