Skip to content

Commit

Permalink
Change content-catalog to content_catalog
Browse files Browse the repository at this point in the history
Closes gh-13
  • Loading branch information
philwebb committed May 2, 2024
1 parent d45b0f1 commit 1da7a5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ It also allows additional `antora.yml` content to be merged.
If you have a zip that already contains HTML files or other assets that should be directly served, you can configure them to be added them during the `contentClassified` event.
A typical example would be adding API documentation (such as javadoc) where the HTML is generated by a different tool.

To specify that include should be merged during the `contentClassified` event you can set the `destination` to `content-catalog`:
To specify that include should be merged during the `contentClassified` event you can set the `destination` to `content_catalog`:

.antora.yml
[,yaml]
Expand All @@ -304,7 +304,7 @@ ext:
zip_contents_collector:
include:
- name: api
destination: content-catalog
destination: content_catalog
----

NOTE: You must ensure that your `antora.yml` files has a valid `version` value after all aggregate zip contents has been merged.
Expand All @@ -321,7 +321,7 @@ ext:
zip_contents_collector:
include:
- name: api
destination: content-catalog
destination: content_catalog
module: my-module
path: api/java
----
Expand All @@ -345,7 +345,7 @@ antora:
- require: '@springio/antora-zip-contents-collector-extension'
always_include:
- name: api
destination: content-catalog
destination: content_catalog
module: my-module
path: api/java
----
Expand Down
7 changes: 5 additions & 2 deletions packages/antora-zip-contents-collector-extension/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function register ({ config, downloadLog }) {
}
}
}
// Once the version is set we can collect content-catalog includes
// Once the version is set we can collect content_catalog includes
for (const componentVersionBucket of contentAggregate) {
const key = componentVersionBucket.version + '@' + componentVersionBucket.name
for (const origin of componentVersionBucket.origins) {
Expand Down Expand Up @@ -117,7 +117,10 @@ function register ({ config, downloadLog }) {
const includes = getIncludes(
config,
origin,
(include) => include.destination && include.destination.toLowerCase() === 'content-catalog'
(include) =>
include.destination &&
(include.destination.toLowerCase() === 'content_catalog' ||
include.destination.toLowerCase() === 'content-catalog')
)
logger.trace(`Collecting '${origin.refname}' content catalog includes ${includes.map((include) => include.name)}`)
await doWithIncludes(config, downloadLog, collectorCacheDir, version, includes, (include, zipFile, file) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ describe('zip contents collector extension', () => {
const extensionConfig = () => ({
locations: [{ url: `http://localhost:${httpServerPort}/\${name}.zip` }],
})
const componentConfig = { include: [{ name: 'javadoc', destination: 'content-catalog', path: 'api/java' }] }
const componentConfig = { include: [{ name: 'javadoc', destination: 'content_catalog', path: 'api/java' }] }
await runScenario({
repoName: 'test-at-root',
extensionConfig,
Expand Down Expand Up @@ -759,7 +759,7 @@ describe('zip contents collector extension', () => {
locations: [{ url: `http://localhost:${httpServerPort}/\${name}.zip` }],
})
const componentConfig = {
include: [{ name: 'javadoc', destination: 'content-catalog', module: 'mymodule', path: 'api/java' }],
include: [{ name: 'javadoc', destination: 'content_catalog', module: 'mymodule', path: 'api/java' }],
}
await runScenario({
repoName: 'test-at-root',
Expand Down

0 comments on commit 1da7a5c

Please sign in to comment.