This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 5a3f9474 Home page: show a camel run command that matches the selected 
DSL tab
5a3f9474 is described below

commit 5a3f947454e8750bbbb90269c82175531091c77d
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Sep 15 09:28:38 2026 +0200

    Home page: show a camel run command that matches the selected DSL tab
    
    The run line under the Kafka-to-database example was a single static
    "camel run kafka-to-db.yaml" regardless of which tab was selected. Move it
    inside each tab panel with its own file name (kafka-to-db.yaml, 
KafkaToDb.java,
    kafka-to-db.xml), so switching tabs switches the command too; the hidden
    panel hides its own line, the same way the copy button already works.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
 data/home.yaml     |  4 +++-
 layouts/index.html | 14 +++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/data/home.yaml b/data/home.yaml
index 936873a3..5aca7f4a 100644
--- a/data/home.yaml
+++ b/data/home.yaml
@@ -109,10 +109,10 @@ example:
   eyebrow: See it in action
   heading: Route messages from Kafka to a database
   subhead: The same route, in your choice of syntax. No boilerplate.
-  run_command: camel run kafka-to-db.yaml
   tabs:
     - id: yaml
       label: YAML
+      run: camel run kafka-to-db.yaml
       code: |
         # Route messages from Kafka into a database
         - from:
@@ -126,6 +126,7 @@ example:
                     VALUES (:#id, :#amount)
     - id: java
       label: Java
+      run: camel run KafkaToDb.java
       code: |
         from("kafka:orders")
             .unmarshal().json()
@@ -133,6 +134,7 @@ example:
               + "VALUES (:#id, :#amount)");
     - id: xml
       label: XML
+      run: camel run kafka-to-db.xml
       code: |
         <route>
           <from uri="kafka:orders"/>
diff --git a/layouts/index.html b/layouts/index.html
index b93cdc43..4d95ee56 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -134,12 +134,16 @@
                 09-home.js already handles any [data-copy-value]. */}}
            {{ if ne $i 0 }}hidden{{ end }}><button class="home-tab-copy" 
type="button"
                    data-copy-value="{{ trim $tab.code "\n" }}"
-                   aria-label="Copy the {{ $tab.label }} 
example">Copy</button>{{ highlight (trim $tab.code "\n") $tab.id "" }}</div>
+                   aria-label="Copy the {{ $tab.label }} 
example">Copy</button>{{ highlight (trim $tab.code "\n") $tab.id "" }}
+        {{- /* The run line lives inside the panel for the same reason as the
+             copy button: each DSL has its own file name, and a hidden panel
+             hides its own command. */}}
+        <p class="home-example-run">
+          <span class="home-example-prompt">$</span>
+          <span class="home-example-command">{{ $tab.run }}</span>
+        </p>
+      </div>
       {{- end }}
-      <p class="home-example-run">
-        <span class="home-example-prompt">$</span>
-        <span class="home-example-command">{{ .run_command }}</span>
-      </p>
     </div>
   </section>
   </div>

Reply via email to