You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2021/03/28 17:52:13 UTC

[lucenenet] 06/06: docs: Changed breadcrumb link to "_api" so we can update it without also updating "_rel", which all of the styles and js links use.

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

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit adc0e6a433a17156835bc5bb88fd395bc06bdd15
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sun Mar 28 20:59:23 2021 +0700

    docs: Changed breadcrumb link to "_api" so we can update it without also updating "_rel", which all of the styles and js links use.
---
 .../apidocs/Templates/LuceneApiDocs/partials/breadcrumb.tmpl.partial | 2 +-
 websites/apidocs/docfx.global.subsite.json                           | 5 +++--
 websites/apidocs/docs.ps1                                            | 5 +++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/websites/apidocs/Templates/LuceneApiDocs/partials/breadcrumb.tmpl.partial b/websites/apidocs/Templates/LuceneApiDocs/partials/breadcrumb.tmpl.partial
index 3a669f0..b12eba1 100644
--- a/websites/apidocs/Templates/LuceneApiDocs/partials/breadcrumb.tmpl.partial
+++ b/websites/apidocs/Templates/LuceneApiDocs/partials/breadcrumb.tmpl.partial
@@ -4,7 +4,7 @@
   <div class="container hide-when-search">
     <ul class="level0 breadcrumb">
         <li>
-            <a href="{{_rel}}">API</a>
+            <a href="{{_api}}">API</a>
              <span id="breadcrumb">
                 <ul class="breadcrumb">
                   <li>{{_tocTitle}}</li>
diff --git a/websites/apidocs/docfx.global.subsite.json b/websites/apidocs/docfx.global.subsite.json
index f9025e5..fafaf8e 100644
--- a/websites/apidocs/docfx.global.subsite.json
+++ b/websites/apidocs/docfx.global.subsite.json
@@ -1,3 +1,4 @@
-{
-  "_rel": "https://lucenenet.apache.org/docs/4.8.0-beta00009/"  
+{
+  "_rel": "https://lucenenet.apache.org/docs/4.8.0-beta00009/",
+  "_api": "https://lucenenet.apache.org/docs/4.8.0-beta00009/"
 }
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index 5de4cae..390da4d 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -54,6 +54,7 @@ $ToolsFolder = Join-Path -Path $ApiDocsFolder -ChildPath "tools";
 $CliIndexPath = Join-Path -Path $RepoRoot -ChildPath "src\dotnet\tools\lucene-cli\docs\index.md";
 $TocPath1 = Join-Path -Path $ApiDocsFolder -ChildPath "toc.yml"
 $TocPath2 = Join-Path -Path $ApiDocsFolder -ChildPath "toc\toc.yml"
+$BreadcrumbPath = Join-Path -Path $ApiDocsFolder -ChildPath "docfx.global.subsite.json"
 
 #ensure the /build/tools folder
 New-Item $ToolsFolder -type directory -force
@@ -192,6 +193,10 @@ if ($? -and $DisableBuild -eq $false) {
     (Get-Content -Path $TocPath1 -Raw) -Replace '(?<=lucenenet\.apache\.org\/docs\/)\d+?\.\d+?\.\d+?(?:\.\d+?)?(?:-\w+)?', $LuceneNetVersion | Set-Content -Path $TocPath1
     (Get-Content -Path $TocPath2 -Raw) -Replace '(?<=lucenenet\.apache\.org\/docs\/)\d+?\.\d+?\.\d+?(?:\.\d+?)?(?:-\w+)?', $LuceneNetVersion | Set-Content -Path $TocPath2
 
+    # Update the API link to the latest LuceneNetVersion
+    # 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
+
     foreach ($proj in $DocFxJsonMeta) {
         $projFile = Join-Path -Path $ApiDocsFolder $proj