@antora/site-publisher
Advanced tools
Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5
'use strict' | ||
const ospath = require('path') | ||
const publishStream = require('./common/publish-stream') | ||
@@ -9,7 +10,7 @@ const { dest: vzipDest } = require('gulp-vinyl-zip') | ||
// FIXME right now we're assuming the archive is a zip | ||
// FIXME relative path should be resolved relative to dir of playbook file | ||
async function publishToArchive (config, files) { | ||
return publishStream(vzipDest(config.path || DEFAULT_DEST_ARCHIVE), files) | ||
async function publishToArchive (config, files, playbook) { | ||
const destFile = ospath.resolve(playbook.dir || process.cwd(), config.path || DEFAULT_DEST_ARCHIVE) | ||
return publishStream(vzipDest(destFile), files) | ||
} | ||
module.exports = publishToArchive |
'use strict' | ||
const fs = require('fs-extra') | ||
const ospath = require('path') | ||
const publishStream = require('./common/publish-stream') | ||
@@ -9,5 +10,4 @@ const { dest: vfsDest } = require('vinyl-fs') | ||
// FIXME relative path should be resolved relative to dir of playbook file | ||
async function publishToFs (config, files) { | ||
const destDir = config.path || DEFAULT_DEST_FS | ||
async function publishToFs (config, files, playbook) { | ||
const destDir = ospath.resolve(playbook.dir || process.cwd(), config.path || DEFAULT_DEST_FS) | ||
return config.clean | ||
@@ -14,0 +14,0 @@ ? fs.remove(destDir).then(() => publishStream(vfsDest(destDir), files)) |
@@ -54,4 +54,3 @@ 'use strict' | ||
try { | ||
// FIXME use playbook dir instead of process.cwd() | ||
return requireProvider(provider, process.cwd()).bind(null, options) | ||
return requireProvider(provider, playbook.dir || process.cwd()).bind(null, options) | ||
} catch (e) { | ||
@@ -58,0 +57,0 @@ throw new Error('Unsupported destination provider: ' + provider) |
{ | ||
"name": "@antora/site-publisher", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0-alpha.5", | ||
"description": "Publishes the files generated in an Antora documentation pipeline to the destination(s) specified in the playbook.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
# Antora Site Publisher | ||
The site publisher is the component in Antora responsible for publishing (i.e., writing) the generated files to the destination(s) specified in the playbook. | ||
More than one destination may be specified, and this component supports different destination types (via providers) such as the filesystem, an archive, and others. | ||
More than one destination may be specified, and this component supports different destination types (via providers) such as a filesystem directory, an archive file, and so forth. | ||
@@ -6,0 +6,0 @@ [Antora](https://antora.org) is a modular static site generator designed for making documentation sites from AsciiDoc aggregated from versioned content repositories and processed with Asciidoctor. |
10514