Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the docindex.yml and rename the functions #1226

Merged
10 commits merged into from
Nov 24, 2020
14 changes: 7 additions & 7 deletions eng/common/docgeneration/Generate-DocIndex.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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]
Expand Down Expand Up @@ -162,18 +162,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=$true)] [String]$appTitleLang,
[Parameter(Mandatory=$true)] [String]$lang = $Language,
[Parameter(Mandatory=$true)] [String]$indexhtmlloc="index.html",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Parameter(Mandatory=$true)] [String]$indexhtmlloc="index.html",
[Parameter(Mandatory=$true)] [String]$indexhtmlloc = "index.html",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

[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
Expand Down
4 changes: 1 addition & 3 deletions eng/common/pipelines/templates/steps/docindex.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
jobs:
- job: CreateDocIndex
variables:
- template: templates/variables/globals.yml
pool:
vmImage: windows-2019
steps:
Expand Down Expand Up @@ -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

Expand Down