Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions antora-playbook-snippets/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ runtime:

antora:
extensions:
- ./extensions/promote-deprecated-attribute.js
- require: '@djencks/antora-aggregate-collector'
# log_level: trace
componentversions:
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions antora-ui-camel/public/_/data/rev-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"css/site.css": "css/site-2c6491cbb6.css",
"css/site.css": "css/site-e7a3c95ff3.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
"img/apache-karaf.svg": "img/apache-karaf-7bdb5ce2e3.svg",
Expand Down Expand Up @@ -28,7 +28,7 @@
"img/karavan.svg": "img/karavan-8621354711.svg",
"img/knative.svg": "img/knative-5010ee4773.svg",
"img/kubernetes.svg": "img/kubernetes-07ba46aaa2.svg",
"img/logo-camel-medium.png": "img/logo-camel-medium-372cf8688f.png",
"img/logo-camel-medium.png": "img/logo-camel-medium-ec76e19c58.png",
"img/logo-d.svg": "img/logo-d-a567cee6fa.svg",
"img/menu.svg": "img/menu-8775cec4be.svg",
"img/quarkus.svg": "img/quarkus-446ffca541.svg",
Expand Down
4 changes: 2 additions & 2 deletions antora-ui-camel/public/_/helpers/asset.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const manifest = {
"css/site.css": "css/site-2c6491cbb6.css",
"css/site.css": "css/site-e7a3c95ff3.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
"img/apache-karaf.svg": "img/apache-karaf-7bdb5ce2e3.svg",
Expand Down Expand Up @@ -30,7 +30,7 @@ const manifest = {
"img/karavan.svg": "img/karavan-8621354711.svg",
"img/knative.svg": "img/knative-5010ee4773.svg",
"img/kubernetes.svg": "img/kubernetes-07ba46aaa2.svg",
"img/logo-camel-medium.png": "img/logo-camel-medium-372cf8688f.png",
"img/logo-camel-medium.png": "img/logo-camel-medium-ec76e19c58.png",
"img/logo-d.svg": "img/logo-d-a567cee6fa.svg",
"img/menu.svg": "img/menu-8775cec4be.svg",
"img/quarkus.svg": "img/quarkus-446ffca541.svg",
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions antora-ui-camel/public/_/partials/article.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ If you typed the URL of this page manually, please double check that you entered
{{#with page.title}}
<h1 class="page">{{{this}}}</h1>
{{/with}}
{{#if page.attributes.deprecated}}
<div class="admonitionblock warning">
<table>
<tbody>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
This {{or page.attributes.shortname 'page'}} is deprecated
</td>
</tr>
</tbody>
</table>
</div>
{{/if}}
{{{page.contents}}}
{{/if}}
{{> pagination}}
Expand Down
2 changes: 1 addition & 1 deletion antora-ui-camel/public/_/partials/head-styles.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link rel="stylesheet" href="{{uiRootPath}}/css/site-2c6491cbb6.css">
<link rel="stylesheet" href="{{uiRootPath}}/css/site-e7a3c95ff3.css">
4 changes: 2 additions & 2 deletions antora-ui-camel/public/_/rev-manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"css/site.css": "css/site-2c6491cbb6.css",
"css/site.css": "css/site-e7a3c95ff3.css",
"img/algolia.svg": "img/algolia-f4ab98e0de.svg",
"img/apache-kafka.svg": "img/apache-kafka-88809b7472.svg",
"img/apache-karaf.svg": "img/apache-karaf-7bdb5ce2e3.svg",
Expand Down Expand Up @@ -28,7 +28,7 @@
"img/karavan.svg": "img/karavan-8621354711.svg",
"img/knative.svg": "img/knative-5010ee4773.svg",
"img/kubernetes.svg": "img/kubernetes-07ba46aaa2.svg",
"img/logo-camel-medium.png": "img/logo-camel-medium-372cf8688f.png",
"img/logo-camel-medium.png": "img/logo-camel-medium-ec76e19c58.png",
"img/logo-d.svg": "img/logo-d-a567cee6fa.svg",
"img/menu.svg": "img/menu-8775cec4be.svg",
"img/quarkus.svg": "img/quarkus-446ffca541.svg",
Expand Down
16 changes: 16 additions & 0 deletions antora-ui-camel/src/partials/article.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ If you typed the URL of this page manually, please double check that you entered
{{#with page.title}}
<h1 class="page">{{{this}}}</h1>
{{/with}}
{{#if page.attributes.deprecated}}
<div class="admonitionblock warning">
<table>
<tbody>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
This {{or page.attributes.shortname 'page'}} is deprecated
</td>
</tr>
</tbody>
</table>
</div>
{{/if}}
{{{page.contents}}}
{{/if}}
{{> pagination}}
Expand Down
42 changes: 42 additions & 0 deletions extensions/promote-deprecated-attribute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict'

/**
* This Antora extension promotes the 'deprecated' and 'supportlevel' AsciiDoc
* document attributes to page attributes so they can be accessed in
* Handlebars templates as page.attributes.deprecated and page.attributes.supportlevel.
*
* This allows the UI to display warning banners for deprecated components.
*/
module.exports.register = function ({ config }) {
this.on('documentsConverted', ({ contentCatalog }) => {
contentCatalog.getPages().forEach((page) => {
if (!page.asciidoc) return

const attributes = page.asciidoc.attributes
if (!attributes) return

// Initialize page attributes if not present
if (!page.asciidoc.attributes['page-deprecated']) {
// Check if the page has deprecated attribute
if (attributes.deprecated !== undefined) {
// Promote deprecated to page-deprecated
page.asciidoc.attributes['page-deprecated'] = attributes.deprecated || 'true'
}
}

if (!page.asciidoc.attributes['page-supportlevel']) {
// Check for supportlevel attribute (e.g., "Stable-deprecated")
if (attributes.supportlevel !== undefined) {
page.asciidoc.attributes['page-supportlevel'] = attributes.supportlevel
}
}

if (!page.asciidoc.attributes['page-shortname']) {
// Check for shortname attribute (e.g., "nitrite", "component")
if (attributes.shortname !== undefined) {
page.asciidoc.attributes['page-shortname'] = attributes.shortname
}
}
})
})
}