From 423c68983e5e0808d6696e828e11683c34e154b3 Mon Sep 17 00:00:00 2001 From: Sima Zhu Date: Mon, 25 Jan 2021 17:45:22 -0800 Subject: [PATCH] Fixed the problem of no display name issue --- eng/common/docgeneration/Generate-DocIndex.ps1 | 2 +- eng/common/docgeneration/docfx.json | 6 ------ .../docgeneration/templates/matthews/styles/main.js | 13 ++++++------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/eng/common/docgeneration/Generate-DocIndex.ps1 b/eng/common/docgeneration/Generate-DocIndex.ps1 index bfdae912e6b2..36194f50d5a1 100644 --- a/eng/common/docgeneration/Generate-DocIndex.ps1 +++ b/eng/common/docgeneration/Generate-DocIndex.ps1 @@ -165,7 +165,7 @@ function UpdateDocIndexFiles { $docfxContent = Get-Content -Path $DocfxJsonPath -Raw $docfxContent = $docfxContent -replace "`"_appTitle`": `"`"", "`"_appTitle`": `"Azure SDK for $appTitleLang`"" $docfxContent = $docfxContent -replace "`"_appFooter`": `"`"", "`"_appFooter`": `"Azure SDK for $appTitleLang`"" - Set-Content -Path $DocfxJsonPath -Value $docfxContent + Set-Content -Path $DocfxJsonPath -Value $docfxContent -NoNewline # Update main.js var lang $mainJsContent = Get-Content -Path $MainJsPath -Raw $mainJsContent = $mainJsContent -replace "var SELECTED_LANGUAGE = ''", "var SELECTED_LANGUAGE = '$lang'" diff --git a/eng/common/docgeneration/docfx.json b/eng/common/docgeneration/docfx.json index 6b113dafd3c0..837478ef9aac 100644 --- a/eng/common/docgeneration/docfx.json +++ b/eng/common/docgeneration/docfx.json @@ -70,9 +70,3 @@ } } } - - - - - - diff --git a/eng/common/docgeneration/templates/matthews/styles/main.js b/eng/common/docgeneration/templates/matthews/styles/main.js index 39fb2c34c649..346a94dad733 100644 --- a/eng/common/docgeneration/templates/matthews/styles/main.js +++ b/eng/common/docgeneration/templates/matthews/styles/main.js @@ -162,8 +162,12 @@ function populateIndexList(selector, packageName) { httpGetLatestAsync(latestPreviewUrl, latestVersions, packageName) var publishedVersions = $('') var collapsible = $('
   Other versions
') - - $(selector).next().after(latestVersions) + // Check whether it has display name tag. + if ($(selector).next().is('h5')) { + $(selector).next().after(latestVersions) + } else { + $(selector).after(latestVersions) + } $(latestVersions).after(collapsible) $(collapsible).after(publishedVersions) // Add collapsible arrows on versioned docs. @@ -216,8 +220,3 @@ $(function () { populateOptions($('#navbar'), pkgName) } }) - - - - -