You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/06/14 16:13:18 UTC
(camel-website) 01/01: fix(#692): reorder sub-projects in version picker by relevance
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch fix/692-reorder-version-picker
in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit 1cfcf8771d681fef9510b50c275177d821ffc181
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Jun 14 18:13:05 2026 +0200
fix(#692): reorder sub-projects in version picker by relevance
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
antora-ui-camel/src/helpers/order_components.js | 35 ++++++++++++-------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/antora-ui-camel/src/helpers/order_components.js b/antora-ui-camel/src/helpers/order_components.js
index f70a702f..ada1b697 100644
--- a/antora-ui-camel/src/helpers/order_components.js
+++ b/antora-ui-camel/src/helpers/order_components.js
@@ -1,26 +1,25 @@
'use strict'
+const order = [
+ 'manual',
+ 'components',
+ 'camel-spring-boot',
+ 'camel-quarkus',
+ 'camel-kamelets',
+ 'camel-k',
+ 'camel-kafka-connector',
+ 'camel-karaf',
+]
+
module.exports = (components) =>
Object.entries(components)
.sort((a, b) => {
- const nameA = a[0]
- const nameB = b[0]
-
- if (nameA === 'manual') {
- return -1
- }
- if (nameB === 'manual') {
- return 1
- }
-
- if (nameA === 'components') {
- return -1
- }
- if (nameB === 'components') {
- return 1
- }
-
- return nameA.localeCompare(nameB)
+ const idxA = order.indexOf(a[0])
+ const idxB = order.indexOf(b[0])
+ if (idxA !== -1 && idxB !== -1) return idxA - idxB
+ if (idxA !== -1) return -1
+ if (idxB !== -1) return 1
+ return a[0].localeCompare(b[0])
})
.reduce((obj, [k, v]) => {
obj[k] = v