@redpanda-data/docs-extensions-and-macros 3.5.2 → 3.5.3
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
|
|
17
|
-
const
|
|
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
|
-
&& !
|
|
24
|
+
&& !isPrerelease // No beta version available, meaning the beta period has ended
|
|
24
25
|
)
|
|
25
26
|
);
|
|
26
27
|
|
|
27
|
-
//
|
|
28
|
+
// Unpublish the shouldUnpublish pages
|
|
28
29
|
if (shouldUnpublish) {
|
|
29
30
|
siteCatalog.unpublishedPages.push(page.pub.url)
|
|
30
31
|
delete page.out;
|