You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by pa...@apache.org on 2026/06/16 19:43:34 UTC
(lucenenet) 17/23: Fix/apidocs breadcrumb toc asf (#1232)
This is an automated email from the ASF dual-hosted git repository.
paulirwin pushed a commit to branch release/4.8.0-beta00018
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit 2660931638261ef6f642dccf10db9f68729bf5e9
Author: Zoltán Katona <92...@users.noreply.github.com>
AuthorDate: Fri Apr 10 06:09:04 2026 +0200
Fix/apidocs breadcrumb toc asf (#1232)
* site: add links to configuration file
Introduces _navbarLinks and _asfLinks configuration in docfx.json including the correct event page link. Adds a new navbar-links partial to render these links and updates the main navbar partial to include it.
* Fix breadcrumb styles in main.css
Now the Api / Libraries works as intended, not splitting into two lines and the slash is restored.
* apidocs: add links to configuration file
Introduces _navbarLinks and _asfLinks configuration in docfx.global.json including the correct event page link. Adds a new navbar-links partial to render these links and updates the main navbar partial to include it.
* apidocs: move links to separate .json
- Added docfx.links.json to organize navigation and ASF links separately. It now includes the links.
- Modified docfx.site.json to include docfx.links.json in globalMetadataFiles.
* Update doc links to use latest Lucene.Net version
Added docfx.links.json to metadata and updated navbar links to point to the latest CI documentation. Enhanced docs.ps1 to automatically update both docfx.links.json with the current LuceneNetVersion during the build process, ensuring navigation and API links always reference the correct version.
* Fix build error by storing navbar links differently and links not appearing inside the apidocs.
- Refactor navbar links to use individual properties and moved to the subsite.json.
- docfx.links.json and navbar-links.tmpl.partial removed.
- docs.ps1 restored as it was originally.
- Removed the link json file reference from the metadata docfx.core.json.
* Update CLI doc link with auto-update and minor changes.
- Change _navCliHref to absolute URL for published CLI docs
- Removed the links jsons globalMetadataFiles leftover and the subsite one was added instead.
- Auto-update CLI doc version in docs.ps1
- Improve navbar template indentation for readability and removed a debug message from it.
* Refactor navbar config to use individual metadata to be uniform with the apidocs
- Replaced array-based navigation link config in docfx.json with individual metadata fields for each link.
- Removed the navbar-links.tmpl.partial template as it become no longer necessary.
- Updated navbar.tmpl.partial to render links directly from the new fields.
* PR feedback: whitespace fixes; a11y improvement for ASF link; use defined titles; shorten header link text so it all fits
---------
Co-authored-by: Paul Irwin <pa...@gmail.com>
---
.../LuceneTemplate/partials/navbar.tmpl.partial | 19 ++++++++
.../Templates/LuceneTemplateAssets/styles/main.css | 50 ++++++++++++++--------
websites/apidocs/docfx.global.subsite.json | 36 ++++++++++++++--
websites/apidocs/docfx.site.json | 3 +-
websites/apidocs/docs.ps1 | 4 +-
websites/apidocs/toc.yml | 2 +-
websites/site/docfx.json | 43 ++++++++++++++++++-
.../lucenetemplate/partials/navbar.tmpl.partial | 22 ++++++++++
8 files changed, 155 insertions(+), 24 deletions(-)
diff --git a/websites/apidocs/Templates/LuceneTemplate/partials/navbar.tmpl.partial b/websites/apidocs/Templates/LuceneTemplate/partials/navbar.tmpl.partial
index 40a4a5188..51cc5e7f4 100644
--- a/websites/apidocs/Templates/LuceneTemplate/partials/navbar.tmpl.partial
+++ b/websites/apidocs/Templates/LuceneTemplate/partials/navbar.tmpl.partial
@@ -32,6 +32,25 @@
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
+ <ul class="nav level1 navbar-nav">
+
+ <li><a href="{{_rel}}{{_api}}" title="{{_navApiTitle}}">{{_navApiText}}</a></li>
+ <li><a href="{{_rel}}{{_navCliHref}}" title="{{_navCliTitle}}">{{_navCliText}}</a></li>
+ <li><a href="{{_navWebsiteHref}}" title="{{_navWebsiteTitle}}">{{_navWebsiteText}}</a></li>
+
+ <li class="nav-asf">
+ <a role="button" tabindex="0">ASF<span class="lucene-caret"></span></a>
+ <ul class="nav level2 asf-menu">
+ <li><a href="{{_asfFoundationHref}}">{{_asfFoundationText}}</a></li>
+ <li><a href="{{_asfEventsHref}}">{{_asfEventsText}}</a></li>
+ <li><a href="{{_asfLicenseHref}}">{{_asfLicenseText}}</a></li>
+ <li><a href="{{_asfThanksHref}}">{{_asfThanksText}}</a></li>
+ <li><a href="{{_asfSecurityHref}}">{{_asfSecurityText}}</a></li>
+ <li><a href="{{_asfSponsorshipHref}}">{{_asfSponsorshipText}}</a></li>
+ <li><a href="{{_asfPrivacyHref}}">{{_asfPrivacyText}}</a></li>
+ </ul>
+ </li>
+ </ul>
</div>
</div>
</nav>
diff --git a/websites/apidocs/Templates/LuceneTemplateAssets/styles/main.css b/websites/apidocs/Templates/LuceneTemplateAssets/styles/main.css
index 1dcebcb3a..728df3b42 100644
--- a/websites/apidocs/Templates/LuceneTemplateAssets/styles/main.css
+++ b/websites/apidocs/Templates/LuceneTemplateAssets/styles/main.css
@@ -522,23 +522,6 @@ header.is-sticky nav.navbar {
display: inline-block;
}
-/* 5.1 Breadcrumb padding adjustments */
-.subnav.navbar #breadcrumb {
- padding-left: 28px;
-}
-
-@media (min-width:1200px) {
- .subnav.navbar #breadcrumb {
- padding-left: 34px;
- }
-}
-
-@media (min-width:1600px) {
- .subnav.navbar #breadcrumb {
- padding-left: 40px;
- }
-}
-
/* 6. First-content padding / margin-collapse prevention
---------------------------------------------------- */
.container.body-content,
@@ -802,3 +785,36 @@ button:focus-visible {
margin-top: 50px !important;
}
}
+
+/* 9.4.1 Keep the inner (level1) trail inline and tidy */
+.subnav.navbar #breadcrumb .breadcrumb {
+ display: inline-flex;
+ align-items: baseline;
+ flex-wrap: wrap;
+ gap: .35rem;
+ margin: 0;
+ padding: 0;
+}
+
+/* 9.4.2 Add the slash after “API/CLI” only when a trail exists */
+.subnav.navbar ul.level0.breadcrumb > li > a::after {
+ content: "";
+}
+/* reset */
+.subnav.navbar ul.level0.breadcrumb > li:has(#breadcrumb .breadcrumb) > a::after {
+ content: " /";
+ margin: 0 .35rem;
+ color: #bbb;
+}
+
+/* 9.4.3 restore the default side padding for the breadcrumb container */
+.subnav.navbar .container {
+ padding: 8px 28px !important; /* 8 top/bottom, 15 left/right */
+}
+
+/* 9.4.4 mobile: add a little extra left indent (28px total feel) */
+@media (max-width: 767px) {
+ .subnav.navbar .container {
+ padding-left: 28px !important; /* right stays 15px */
+ }
+}
diff --git a/websites/apidocs/docfx.global.subsite.json b/websites/apidocs/docfx.global.subsite.json
index 89299bfa0..58c6365cf 100644
--- a/websites/apidocs/docfx.global.subsite.json
+++ b/websites/apidocs/docfx.global.subsite.json
@@ -1,4 +1,34 @@
-{
- "_api": "https://lucenenet.apache.org/docs/4.8.0-ci/"
-}
+{
+ "_api": "https://lucenenet.apache.org/docs/4.8.0-ci/",
+ "_navApiTitle": "Lucene.Net API",
+ "_navApiText": "Lucene.Net API",
+
+ "_navCliHref": "https://lucenenet.apache.org/docs/4.8.0-ci/cli/index.html",
+ "_navCliTitle": "Lucene.Net CLI",
+ "_navCliText": "Lucene.Net CLI",
+
+ "_navWebsiteHref": "https://lucenenet.apache.org/",
+ "_navWebsiteTitle": "Lucene.Net Website",
+ "_navWebsiteText": "Lucene.Net Website",
+
+ "_asfFoundationHref": "https://www.apache.org/",
+ "_asfFoundationText": "Foundation",
+
+ "_asfEventsHref": "https://events.apache.org/",
+ "_asfEventsText": "Events",
+ "_asfLicenseHref": "https://www.apache.org/licenses/",
+ "_asfLicenseText": "License",
+
+ "_asfThanksHref": "https://www.apache.org/foundation/thanks.html",
+ "_asfThanksText": "Thanks",
+
+ "_asfSecurityHref": "https://www.apache.org/security/",
+ "_asfSecurityText": "Security",
+
+ "_asfSponsorshipHref": "https://www.apache.org/foundation/sponsorship.html",
+ "_asfSponsorshipText": "Sponsorship",
+
+ "_asfPrivacyHref": "https://privacy.apache.org/policies/privacy-policy-public.html",
+ "_asfPrivacyText": "Privacy Policy"
+}
diff --git a/websites/apidocs/docfx.site.json b/websites/apidocs/docfx.site.json
index aea666244..4c8c7f1b3 100644
--- a/websites/apidocs/docfx.site.json
+++ b/websites/apidocs/docfx.site.json
@@ -57,7 +57,8 @@
],
"dest": "_site",
"globalMetadataFiles": [
- "docfx.global.json"
+ "docfx.global.json",
+ "docfx.global.subsite.json"
],
"template": [
"default",
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index 80bbbddfa..23cfff55f 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -72,7 +72,6 @@ try {
Set-Location $PreviousLocation
}
-
# delete anything that already exists
if ($Clean) {
Write-Host "Cleaning..."
@@ -184,6 +183,9 @@ if ($? -and $DisableBuild -eq $false) {
# Note we don't update _rel because that is used for styles and js
(Get-Content -Path $BreadcrumbPath -Raw) -Replace '(?<="_api":\s*?"https?\:\/\/lucenenet\.apache\.org\/docs\/)\d+?\.\d+?\.\d+?(?:\.\d+?)?(?:-\w+)?', $LuceneNetVersion | Set-Content -Path $BreadcrumbPath
+ # Update the CLI link to the latest LuceneNetVersion
+ (Get-Content -Path $BreadcrumbPath -Raw) -Replace '(?<="_navCliHref":\s*?"https?\:\/\/lucenenet\.apache\.org\/docs\/)\d+?\.\d+?\.\d+?(?:\.\d+?)?(?:-\w+)?', $LuceneNetVersion | Set-Content -Path $BreadcrumbPath
+
foreach ($proj in $DocFxJsonMeta) {
$projFile = Join-Path -Path $ApiDocsFolder $proj
diff --git a/websites/apidocs/toc.yml b/websites/apidocs/toc.yml
index 69fd8682f..9024d599e 100644
--- a/websites/apidocs/toc.yml
+++ b/websites/apidocs/toc.yml
@@ -11,7 +11,7 @@
- name: Foundation
href: https://www.apache.org/
- name: Events
- href: https://www.apache.org/events/
+ href: https://events.apache.org/
- name: License
href: https://www.apache.org/licenses/
- name: Thanks
diff --git a/websites/site/docfx.json b/websites/site/docfx.json
index 47a525640..100ba012f 100644
--- a/websites/site/docfx.json
+++ b/websites/site/docfx.json
@@ -45,7 +45,48 @@
"_gitContribute": {
"repo": "https://github.com/apache/lucenenet",
"branch": "master"
- }
+ },
+
+ "_navAboutHref": "/#about",
+ "_navAboutTitle": "About",
+ "_navAboutText": "About",
+
+ "_navQuickStartHref": "/quick-start/index.html",
+ "_navQuickStartTitle": "Quick Start",
+ "_navQuickStartText": "Quick Start",
+
+ "_navDownloadHref": "/download/download.html",
+ "_navDownloadTitle": "Download",
+ "_navDownloadText": "Download",
+
+ "_navDocsHref": "/docs.html",
+ "_navDocsTitle": "Documentation",
+ "_navDocsText": "Documentation",
+
+ "_navContributingHref": "/contributing/index.html",
+ "_navContributingTitle": "Contributing",
+ "_navContributingText": "Contributing",
+
+ "_asfFoundationHref": "https://www.apache.org/",
+ "_asfFoundationText": "Foundation",
+
+ "_asfEventsHref": "https://events.apache.org/",
+ "_asfEventsText": "Events",
+
+ "_asfLicenseHref": "https://www.apache.org/licenses/",
+ "_asfLicenseText": "License",
+
+ "_asfThanksHref": "https://www.apache.org/foundation/thanks.html",
+ "_asfThanksText": "Thanks",
+
+ "_asfSecurityHref": "https://www.apache.org/security/",
+ "_asfSecurityText": "Security",
+
+ "_asfSponsorshipHref": "https://www.apache.org/foundation/sponsorship.html",
+ "_asfSponsorshipText": "Sponsorship",
+
+ "_asfPrivacyHref": "https://privacy.apache.org/policies/privacy-policy-public.html",
+ "_asfPrivacyText": "Privacy Policy"
},
"dest": "_site",
"globalMetadataFiles": [],
diff --git a/websites/site/lucenetemplate/partials/navbar.tmpl.partial b/websites/site/lucenetemplate/partials/navbar.tmpl.partial
index ab8f5195d..14e2e89bb 100644
--- a/websites/site/lucenetemplate/partials/navbar.tmpl.partial
+++ b/websites/site/lucenetemplate/partials/navbar.tmpl.partial
@@ -17,6 +17,28 @@
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
+
+ <ul class="nav level1 navbar-nav">
+ <li><a href="{{_navAboutHref}}" title="{{_navAboutTitle}}">{{_navAboutText}}</a></li>
+ <li><a href="{{_navQuickStartHref}}" title="{{_navQuickStartTitle}}">{{_navQuickStartText}}</a></li>
+ <li><a href="{{_navDownloadHref}}" title="{{_navDownloadTitle}}">{{_navDownloadText}}</a></li>
+ <li><a href="{{_navDocsHref}}" title="{{_navDocsTitle}}">{{_navDocsText}}</a></li>
+ <li><a href="{{_navContributingHref}}" title="{{_navContributingTitle}}">{{_navContributingText}}</a></li>
+
+ <!-- ASF dropdown -->
+ <li class="nav-asf">
+ <a role="button" tabindex="0">ASF<span class="lucene-caret"></span></a>
+ <ul class="nav level2 asf-menu">
+ <li><a href="{{_asfFoundationHref}}">{{_asfFoundationText}}</a></li>
+ <li><a href="{{_asfEventsHref}}">{{_asfEventsText}}</a></li>
+ <li><a href="{{_asfLicenseHref}}">{{_asfLicenseText}}</a></li>
+ <li><a href="{{_asfThanksHref}}">{{_asfThanksText}}</a></li>
+ <li><a href="{{_asfSecurityHref}}">{{_asfSecurityText}}</a></li>
+ <li><a href="{{_asfSponsorshipHref}}">{{_asfSponsorshipText}}</a></li>
+ <li><a href="{{_asfPrivacyHref}}">{{_asfPrivacyText}}</a></li>
+ </ul>
+ </li>
+ </ul>
</div>
</div>
</nav>