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 e961a0b5 chore: drop the eyebrow label above the title from the 
Markdown mirrors
e961a0b5 is described below

commit e961a0b5742be5bda18e4fd8b31d36fd68a91ac7
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Sep 18 16:50:12 2026 +0200

    chore: drop the eyebrow label above the title from the Markdown mirrors
    
    The Antora UI renders the component title (User manual, Camel Components)
    in a div.doc-eyebrow above every page title. Converted to Markdown it
    became a stray line before the heading; the converter and the index
    generator now remove it like the other page chrome.
    
    Closes #1774
---
 gulp/helpers/html-index.js      | 4 ++--
 gulp/tasks/generate-markdown.js | 5 +++--
 test/generate-markdown-test.js  | 3 ++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gulp/helpers/html-index.js b/gulp/helpers/html-index.js
index 4409a8d5..03af79ed 100644
--- a/gulp/helpers/html-index.js
+++ b/gulp/helpers/html-index.js
@@ -36,8 +36,8 @@ async function generateHtmlIndex(config) {
       return;
     }
 
-    // Remove navigation elements
-    const elementsToRemove = mainContent.querySelectorAll('nav, header, 
footer, .nav, .navbar, .toolbar');
+    // Remove navigation elements and the eyebrow label above the title
+    const elementsToRemove = mainContent.querySelectorAll('nav, header, 
footer, .nav, .navbar, .toolbar, .doc-eyebrow');
     elementsToRemove.forEach(el => el.remove());
 
     // Remove anchor links
diff --git a/gulp/tasks/generate-markdown.js b/gulp/tasks/generate-markdown.js
index 863fb0b8..d6d191b4 100644
--- a/gulp/tasks/generate-markdown.js
+++ b/gulp/tasks/generate-markdown.js
@@ -133,8 +133,9 @@ function convertPage(htmlContent, turndownService, { 
articleOnly = false } = {})
     trimBlogPost(mainContent);
   }
 
-  // Remove navigation elements, headers, footers and the embedded table of 
contents from the content
-  const elementsToRemove = mainContent.querySelectorAll('nav, header, footer, 
.nav, .navbar, .toolbar, aside.toc');
+  // Remove navigation elements, headers, footers, the embedded table of 
contents and the eyebrow
+  // label above the title (the Antora UI puts the component title there, e.g. 
"User manual")
+  const elementsToRemove = mainContent.querySelectorAll('nav, header, footer, 
.nav, .navbar, .toolbar, aside.toc, .doc-eyebrow');
   elementsToRemove.forEach(el => el.remove());
 
   // Remove anchor links (they are just UI navigation aids)
diff --git a/test/generate-markdown-test.js b/test/generate-markdown-test.js
index 3bd9c0ce..47236cdb 100644
--- a/test/generate-markdown-test.js
+++ b/test/generate-markdown-test.js
@@ -19,7 +19,8 @@ const LATER_SECTION = `<div class="sect2">
 </div>`
 
 test('a well-formed page converts its article, dropping anchors and rewriting 
.html links', () => {
-  const html = page(`<h2 id="_intro"><a class="anchor" 
href="#_intro"></a>Intro</h2>
+  const html = page(`<div class="doc-eyebrow">User manual</div>
+<h2 id="_intro"><a class="anchor" href="#_intro"></a>Intro</h2>
 <div class="paragraph">
 <p>Use <code>camel run</code>, see <a href="other.html">Other</a>.</p>
 </div>`)

Reply via email to