diff --git a/eng/common/docgeneration/Generate-DocIndex.ps1 b/eng/common/docgeneration/Generate-DocIndex.ps1 index 84fd562715508..cb7b1051473bf 100644 --- a/eng/common/docgeneration/Generate-DocIndex.ps1 +++ b/eng/common/docgeneration/Generate-DocIndex.ps1 @@ -9,7 +9,6 @@ Param ( $MainJsPath = "${PSScriptRoot}\templates\matthews\styles\main.js" ) . "${PSScriptRoot}\..\scripts\common.ps1" -$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex" # Given the metadata url under https://github.com/Azure/azure-sdk/tree/master/_data/releases/latest, # the function will return the csv metadata back as part of response. @@ -119,7 +118,7 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) { New-Item -Path $YmlPath -Name "toc.yml" -Force $visitedService = @{} # Sort and display toc service name by alphabetical order, and then sort artifact by order. - foreach ($serviceMapping in ($tocContent.GetEnumerator() | Sort-Object Value[0], Key)) { + foreach ($serviceMapping in ($tocContent.GetEnumerator() | Sort-Object Value, Key)) { $artifact = $serviceMapping.Key $serviceName = $serviceMapping.Value[0] $displayName = $serviceMapping.Value[1] @@ -162,18 +161,18 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) { Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force } -function Mutate-Files { +function UpdateDocIndexFiles { Param ( - [Parameter(Mandatory=$true)] [String]$appTitle, - [Parameter(Mandatory=$true)] [String]$lang, - [Parameter(Mandatory=$true)] [String]$indexhtmlloc, + [Parameter(Mandatory=$false)] [String]$appTitleLang = $Language, + [Parameter(Mandatory=$false)] [String]$lang = $Language, + [Parameter(Mandatory=$false)] [String]$indexhtmlloc = "index.html", [Parameter(Mandatory=$false)] [String]$packageRegex = "`"`"", [Parameter(Mandatory=$false)] [String]$regexReplacement = "" ) # Update docfx.json $docfxContent = Get-Content -Path $DocfxJsonPath -Raw - $docfxContent = $docfxContent -replace "`"_appTitle`": `"`"", "`"_appTitle`": `"$appTitle`"" - $docfxContent = $docfxContent -replace "`"_appFooter`": `"`"", "`"_appFooter`": `"$appTitle`"" + $docfxContent = $docfxContent -replace "`"_appTitle`": `"`"", "`"_appTitle`": `"Azure SDK for $appTitleLang`"" + $docfxContent = $docfxContent -replace "`"_appFooter`": `"`"", "`"_appFooter`": `"Azure SDK for $appTitleLang`"" Set-Content -Path $DocfxJsonPath -Value $docfxContent # Update main.js var lang $mainJsContent = Get-Content -Path $MainJsPath -Raw @@ -192,5 +191,5 @@ if ($GetGithubIoDocIndexFn -and (Test-Path "function:$GetGithubIoDocIndexFn")) } else { - LogWarning "The function '$GetGithubIoDocIndexFn' was not found." + LogWarning "The function 'GetGithubIoDocIndexFn' was not found." } diff --git a/eng/common/pipelines/templates/steps/docindex.yml b/eng/common/pipelines/templates/steps/docindex.yml index 002c009bc6a3d..488c835a82894 100644 --- a/eng/common/pipelines/templates/steps/docindex.yml +++ b/eng/common/pipelines/templates/steps/docindex.yml @@ -1,7 +1,5 @@ jobs: - job: CreateDocIndex - variables: - - template: templates/variables/globals.yml pool: vmImage: windows-2019 steps: @@ -49,7 +47,7 @@ jobs: targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site - pwsh: | - git checkout -b gh-pages-local --track origin/gh-pages-root + git checkout -b gh-pages-local --track origin/gh-pages-root -f workingDirectory: $(Build.SourcesDirectory) displayName: Git pull GH pages branch diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index e9a4e07099932..fd9f40637d056 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -33,4 +33,5 @@ if (-not $LanguageShort) $GetPackageInfoFromRepoFn = "Get-${Language}-PackageInfoFromRepo" $GetPackageInfoFromPackageFileFn = "Get-${Language}-PackageInfoFromPackageFile" $PublishGithubIODocsFn = "Publish-${Language}-GithubIODocs" -$UpdateDocCIFn = "Update-${Language}-CIConfig" \ No newline at end of file +$UpdateDocCIFn = "Update-${Language}-CIConfig" +$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex" \ No newline at end of file