diff --git a/docs/antora-linked-worktree-patch.js b/docs/antora-linked-worktree-patch.js deleted file mode 100644 index 43e4145211..0000000000 --- a/docs/antora-linked-worktree-patch.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict' - -/* Copyright (c) 2002-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const { promises: fsp } = require('fs') -const ospath = require('path') - -/** - * Rewrites local content sources to support the use of linked worktrees. - * - * @author Dan Allen - */ -module.exports.register = function () { - this.once('playbookBuilt', async ({ playbook }) => { - const expandPath = this.require('@antora/expand-path-helper') - for (const contentSource of playbook.content.sources) { - const { url, branches } = contentSource - if (url.charAt() !== '.') continue - const absdir = expandPath(url, { dot: playbook.dir }) - const gitfile = ospath.join(absdir, '.git') - if (await fsp.stat(gitfile).then((stat) => !stat.isDirectory(), () => false)) { - const worktreeGitdir = await fsp.readFile(gitfile, 'utf8') - .then((contents) => contents.trimRight().substr(8)) - const worktreeBranch = await fsp.readFile(ospath.join(worktreeGitdir, 'HEAD'), 'utf8') - .then((contents) => contents.trimRight().replace(/^ref: (?:refs\/heads\/)?/, '')) - const reldir = ospath.relative( - playbook.dir, - await fsp.readFile(ospath.join(worktreeGitdir, 'commondir'), 'utf8') - .then((contents) => { - const gitdir = ospath.join(worktreeGitdir, contents.trimRight()) - return ospath.basename(gitdir) === '.git' ? ospath.dirname(gitdir) : gitdir - }) - ) - contentSource.url = reldir ? `.${ospath.sep}${reldir}` : '.' - if (!branches) continue - contentSource.branches = (branches.constructor === Array ? branches : [branches]) - .map((pattern) => pattern.replaceAll('HEAD', worktreeBranch)) - } - } - }) -} diff --git a/docs/local-antora-playbook.yml b/docs/local-antora-playbook.yml index e6245c7a7c..b58142e2eb 100644 --- a/docs/local-antora-playbook.yml +++ b/docs/local-antora-playbook.yml @@ -1,7 +1,6 @@ # The purpose of this Antora playbook is to generate a preview of the docs in the current branch. antora: extensions: - - ./antora-linked-worktree-patch.js - '@antora/collector-extension' site: title: Spring Security diff --git a/docs/spring-security-docs.gradle b/docs/spring-security-docs.gradle index 708a22542f..2ec3e11365 100644 --- a/docs/spring-security-docs.gradle +++ b/docs/spring-security-docs.gradle @@ -6,7 +6,7 @@ apply plugin: 'io.spring.convention.docs' apply plugin: 'java' antora { - version = '~3.1' + version = '3.2.0-alpha.2' playbook = file('local-antora-playbook.yml') options = ['--clean', '--stacktrace'] environment = [ @@ -15,7 +15,7 @@ antora { 'ALGOLIA_INDEX_NAME': 'security-docs' ] dependencies = [ - '@antora/collector-extension': '1.0.0-alpha.2' + '@antora/collector-extension': '1.0.0-alpha.3' ] }