@redpanda-data/docs-extensions-and-macros 3.5.2 → 3.5.4

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.
@@ -5,26 +5,27 @@ module.exports.register = function () {
5
5
  // Get all pages that have an `out` property
6
6
  const pages = contentCatalog.getPages((page) => page.out);
7
7
  let componentName;
8
+ let pageVersion;
8
9
  siteCatalog.unpublishedPages = []
9
10
 
10
- // Iterate over each page
11
11
  pages.forEach((page) => {
12
- // Retrieve the component associated with the page
12
+ // Retrieve the component metadata associated with the page
13
13
  componentName = page.asciidoc?.attributes['page-component-name'];
14
+ pageVersion = page.asciidoc?.attributes['page-component-version'];
14
15
  const component = contentCatalog.getComponent(componentName);
15
16
 
16
- // Check if the component has a latest prerelease
17
- const prerelease = component && component.latestPrerelease ? component.latestPrerelease : false;
17
+ // Check if the page is part of the beta version
18
+ const isPrerelease = component && pageVersion && component.latestPrerelease && component.latestPrerelease.version === pageVersion;
18
19
 
19
20
  // Check the conditions for unpublishing the page
20
21
  const shouldUnpublish = (
21
22
  page.asciidoc?.attributes['page-unpublish'] ||
22
23
  (page.asciidoc?.attributes['publish-only-during-beta']
23
- && !prerelease // No beta version available, meaning the beta period has ended
24
+ && !isPrerelease // No beta version available, meaning the beta period has ended
24
25
  )
25
26
  );
26
27
 
27
- // If any condition is met, unpublish the page
28
+ // Unpublish the shouldUnpublish pages
28
29
  if (shouldUnpublish) {
29
30
  siteCatalog.unpublishedPages.push(page.pub.url)
30
31
  delete page.out;
@@ -19,7 +19,7 @@ const github = new OctokitWithRetries(githubOptions);
19
19
  module.exports = async () => {
20
20
  try {
21
21
  const release = await github.rest.repos.getLatestRelease({ owner, repo });
22
- tag = release.data.tag_name;
22
+ tag = release.data.tag_name.replace(/^v/, '');
23
23
  return tag;
24
24
  } catch (error) {
25
25
  console.error(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",