Skip to content

Commit f047958

Browse files
authored
New website (#2775)
This pull request introduces significant changes to the documentation and build process. It removes outdated documentation files and content related to Azure DevOps Migration Tools and replaces the Jekyll-based site generation with Hugo. Below is a summary of the most important changes: ### Build Process Updates: * Replaced the Jekyll-based build process with Hugo in `.github/workflows/main.yml`. This includes setting up Hugo, configuring the build environment, and updating the output directory to `./public` instead of `./_site2`. ### Documentation Cleanup: * Removed outdated documentation files, including `404.md`, `MigrationTools.Documentation.csproj`, and various `index.md` files for topics like Endpoints, FieldMaps, Processors, and more. These files contained deprecated or redundant content. [[1]](diffhunk://#diff-97ebf6b847bced95d0648ef962a3ab78b3c7c6d1aba2b52cb75f97a30b3a602eL1-L12) [[2]](diffhunk://#diff-8d70ae8286a3df0c5c01bbcacbe1e45ecf5838bb82e60a1a5d9089c5a06036bbL1-L13) [[3]](diffhunk://#diff-3424f775f9e81396dbf62faf76dda6f5934afb94ffcc13ea615c673742879641L1-L29) [[4]](diffhunk://#diff-6e8b7e5850bc21250a329cbf3524d9b64027a866856ce2b7cdcd7a2071502bc0L1-L37) [[5]](diffhunk://#diff-1fa19c4849eff73f4847d1f3b80c10913a5708446e9f776f20ff2e280fa170abL1-L12) [[6]](diffhunk://#diff-3709bb29111fea49f7f57f9cf8d264ffd6ce19a89a0c4375cfc6ee79f35f3b51L1-L25) [[7]](diffhunk://#diff-e7772b698cd680cba25e8ce9cebf5c5ba990084259e72db8d1f80c72ce5e51d8L1-L41) [[8]](diffhunk://#diff-236846ba750d27a589590a410425aad25d009108f013a872a14a597c1681780fL1-L7) [[9]](diffhunk://#diff-e8867f2191af401902fcd3eec9f8b3b27614933e6b61f176dec926200181030aL1-L61) [[10]](diffhunk://#diff-7185f8300d2b6c456326f1602b1c12addbb0df7211a717e77282fd4d2763c9bcL1-L83) [[11]](diffhunk://#diff-dc2b2f4d7c8991226cde39f682d842fc48a7873aebeba5ce2218a6bc01268484L1-L8) [[12]](diffhunk://#diff-79029a4aee19f388b7e82ea4c61774709186a66584ba13e49c43dedae4666ef2L1-L33) [[13]](diffhunk://#diff-e588b83376687f276dab821795b877d695f4be4dd4b26ed46229e5e49d66ac18L1-L39) [[14]](diffhunk://#diff-13c2a1e46ad11f70be71e09e24e9c02ddbed3b48fb50e715968d7d98469abaa2L1-L13) [[15]](diffhunk://#diff-c1e52b82b7b0af2afbe2f0c37dd58e381253911965ff41d7fa11850fd47edfa4L1-L109) [[16]](diffhunk://#diff-d5cd51996e4f15de3711a281fe3568893c2251d9bd6d90b3e34f03c54a5ccd62L1-L28) These changes streamline the documentation and modernize the build process, improving maintainability and aligning with current standards.
2 parents 817b671 + 77d2d67 commit f047958

File tree

312 files changed

+10325
-11009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+10325
-11009
lines changed

.backup/old-jekyll-site-backup.zip

1.33 MB
Binary file not shown.

.github/workflows/main.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -362,43 +362,38 @@ jobs:
362362
name: "Build Documentation output"
363363
runs-on: ubuntu-latest
364364
if: ${{ success() }}
365-
needs: [Setup, build]
365+
needs: [Setup]
366366
env:
367367
GitVersion_SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
368368
GitVersion_AssemblySemVer: ${{ needs.Setup.outputs.GitVersion_AssemblySemVer }}
369369
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
370370
steps:
371371
- uses: actions/checkout@v4
372-
- name: Setup Ruby
373-
uses: ruby/setup-ruby@v1 # v1.161.0
374-
with:
375-
ruby-version: '3.2' # Not needed with a .ruby-version file
376-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
377-
cache-version: 0 # Increment this number if you need to re-download cached gems
378372
- uses: cschleiden/replace-tokens@v1
379373
with:
380-
files: '["**/*.html"]'
374+
files: '["**/*.html", "**/*.yaml"]'
381375
tokenPrefix: "#{"
382376
tokenSuffix: "}#"
383377
env:
384378
GitVersion_SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
385379
GitVersion_AssemblySemVer: ${{ needs.Setup.outputs.GitVersion_AssemblySemVer }}
386380
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
387381
GitVersion.SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
388-
- uses: igsekor/[email protected]
389-
id: spellcheck
390-
name: Spellcheck
391-
- name: Build with Jekyll 2
392-
# Outputs to the './_site' directory by default
393-
run: bundle exec jekyll build --destination ./_site2/ --baseurl "${{needs.Setup.outputs.nkdAgility_DocsBaseURL_AFD}}"
394-
env:
395-
JEKYLL_ENV: production
396-
# - name: Build Jekyll
397-
# uses: jerryjvl/jekyll-build-action@v1
382+
- name: Setup Hugo
383+
uses: peaceiris/actions-hugo@v3
384+
with:
385+
extended: true
386+
hugo-version: 'latest'
387+
- name: Build
388+
run: |
389+
$environment = "${{ needs.Setup.outputs.nkdAgility_Ring }}".ToLower()
390+
Write-Host "Building site for $environment ";
391+
$env:HUGO_ENV = "$environment";
392+
hugo --source docs --config hugo.yaml,hugo.$environment.yaml --logLevel debug; # --minify
398393
- uses: actions/upload-artifact@v4
399394
with:
400395
name: AzureDevOpsMigrationTools-Site2
401-
path: ./_site2/**/*
396+
path: ./public/**/*
402397

403398

404399
# GitHubRelease
@@ -412,7 +407,7 @@ jobs:
412407
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
413408
GitVersion_NuGetVersion: ${{ needs.Setup.outputs.GitVersion_NuGetVersion }}
414409
GitVersion_PreReleaseLabel: ${{ needs.Setup.outputs.GitVersion_PreReleaseLabel }}
415-
needs: [build, Setup]
410+
needs: [build, Setup, BuildDocs]
416411
if: ${{ success() && ( needs.Setup.outputs.nkdAgility_RunRelease == 'true' ) }}
417412
steps:
418413
- uses: actions/download-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,4 @@ docs/Reference/Generated/MigrationTools.Host.xml
166166
logs/
167167
/staging/
168168
/docs/Reference/Generated
169+
/public/

.powershell/docs/FixHugoLinks.ps1

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
#!/usr/bin/env pwsh
2+
3+
<#
4+
.SYNOPSIS
5+
Converts Jekyll-style markdown links to Hugo rel shortcode format
6+
.DESCRIPTION
7+
This script scans all markdown files in the docs/content directory and converts
8+
Jekyll-style links (e.g., /setup/installation.md) to Hugo rel shortcode format
9+
(e.g., {{ rel "docs/setup/installation" }})
10+
.EXAMPLE
11+
.\FixHugoLinks.ps1
12+
.\FixHugoLinks.ps1 -Verbose
13+
#>
14+
15+
[CmdletBinding()]
16+
param()
17+
18+
# Define the root directory for content
19+
$ContentDir = "docs/content"
20+
$DocsDir = "docs"
21+
22+
# Check if we're in the right directory
23+
if (-not (Test-Path $ContentDir)) {
24+
Write-Error "Content directory '$ContentDir' not found. Please run this script from the repository root."
25+
exit 1
26+
}
27+
28+
# Define link mappings from Jekyll to Hugo format
29+
$linkMappings = @{
30+
# Setup pages
31+
"/setup/installation.md" = "docs/setup/installation"
32+
"/setup/permissions.md" = "docs/setup/permissions"
33+
"/setup/reflectedworkitemid.md" = "docs/setup/reflectedworkitemid"
34+
35+
# General docs references
36+
"/docs/Reference/index.md" = "docs/reference"
37+
"/docs/Reference/v1/Processors/WorkItemMigrationConfig.md" = "docs/reference/processors/work-item-tracking-processor"
38+
39+
# Processor references (Jekyll _reference format to Hugo)
40+
"_reference/reference.processors.tfsworkitemmigrationprocessor.md" = "docs/reference/processors/tfs-workitem-migration-processor"
41+
"_reference/reference.processors.tfsworkitembulkeditprocessor.md" = "docs/reference/processors/tfs-workitem-bulk-edit-processor"
42+
"_reference/reference.processors.tfsworkitemdeleteprocessor.md" = "docs/reference/processors/tfs-workitem-delete-processor"
43+
"_reference/reference.processors.tfsworkitemoverwriteprocessor.md" = "docs/reference/processors/tfs-workitem-overwrite-processor"
44+
"_reference/reference.processors.tfsworkitemoverwriteareasastagsprocessor.md" = "docs/reference/processors/tfs-workitem-overwrite-areas-as-tags-processor"
45+
"_reference/reference.processors.workitemtrackingprocessor.md" = "docs/reference/processors/work-item-tracking-processor"
46+
"_reference/reference.processors.azuredevopspipelineprocessor.md" = "docs/reference/processors/azure-devops-pipeline-processor"
47+
"_reference/reference.processors.processdefinitionprocessor.md" = "docs/reference/processors/process-definition-processor"
48+
"_reference/reference.processors.tfssharedqueryprocessor.md" = "docs/reference/processors/tfs-shared-query-processor"
49+
"_reference/reference.processors.tfsteamsettingsprocessor.md" = "docs/reference/processors/tfs-team-settings-processor"
50+
"_reference/reference.processors.tfstestconfigurationsmigrationprocessor.md" = "docs/reference/processors/tfs-test-configurations-migration-processor"
51+
"_reference/reference.processors.tfstestplansandsuitesmigrationprocessor.md" = "docs/reference/processors/tfs-test-plans-and-suites-migration-processor"
52+
"_reference/reference.processors.tfstestvariablesmigrationprocessor.md" = "docs/reference/processors/tfs-test-variables-migration-processor"
53+
"_reference/reference.processors.tfsexportprofilepicturefromadprocessor.md" = "docs/reference/processors/tfs-export-profile-picture-from-a-d-processor"
54+
"_reference/reference.processors.tfsexportusersformappingprocessor.md" = "docs/reference/processors/tfs-export-users-for-mapping-processor"
55+
"_reference/reference.processors.tfsimportprofilepictureprocessor.md" = "docs/reference/processors/tfs-import-profile-picture-processor"
56+
"_reference/reference.processors.keepoutboundlinktargetprocessor.md" = "docs/reference/processors/keep-outbound-link-target-processor"
57+
"_reference/reference.processors.outboundlinkcheckingprocessor.md" = "docs/reference/processors/outbound-link-checking-processor"
58+
59+
# Tool references (Jekyll _reference format to Hugo)
60+
"_reference/reference.tools.tfsgitrepositorytool.md" = "docs/reference/tools/tfs-git-repository-tool"
61+
"_reference/reference.tools.tfschangesetmappingtool.md" = "docs/reference/tools/tfs-change-set-mapping-tool"
62+
"_reference/reference.tools.tfsattachmenttool.md" = "docs/reference/tools/tfs-attachment-tool"
63+
"_reference/reference.tools.tfsembededimagestool.md" = "docs/reference/tools/tfs-embeded-images-tool"
64+
"_reference/reference.tools.tfsnodestructuretool.md" = "docs/reference/tools/tfs-node-structure-tool"
65+
"_reference/reference.tools.tfsrevisionmanagertool.md" = "docs/reference/tools/tfs-revision-manager-tool"
66+
"_reference/reference.tools.tfsteamsettingstool.md" = "docs/reference/tools/tfs-team-settings-tool"
67+
"_reference/reference.tools.tfsusermappingtool.md" = "docs/reference/tools/tfs-user-mapping-tool"
68+
"_reference/reference.tools.tfsvalidaterequiredfieldtool.md" = "docs/reference/tools/tfs-validate-required-field-tool"
69+
"_reference/reference.tools.tfsworkitemembededlinktool.md" = "docs/reference/tools/tfs-work-item-embeded-link-tool"
70+
"_reference/reference.tools.tfsworkitemlinktool.md" = "docs/reference/tools/tfs-work-item-link-tool"
71+
"_reference/reference.tools.workitemtypemappingtool.md" = "docs/reference/tools/work-item-type-mapping-tool"
72+
"_reference/reference.tools.stringmanipulatortool.md" = "docs/reference/tools/string-manipulator-tool"
73+
"_reference/reference.tools.fieldmappingtool.md" = "docs/reference/tools/field-mapping-tool"
74+
}
75+
76+
# Function to convert markdown links to Hugo rel shortcode
77+
function ConvertMarkdownLinksToHugo {
78+
param(
79+
[string]$filePath,
80+
[hashtable]$mappings
81+
)
82+
83+
$content = Get-Content -Path $filePath -Raw
84+
$changesMade = $false
85+
86+
Write-Verbose "Processing file: $filePath"
87+
88+
# Convert each mapping
89+
foreach ($oldLink in $mappings.Keys) {
90+
$newLink = $mappings[$oldLink]
91+
92+
# Pattern to match markdown links with the old format
93+
$pattern = '\[([^\]]+)\]\(' + [regex]::Escape($oldLink) + '\)'
94+
$replacement = '[$1]({{< ref "' + $newLink + '" >}})'
95+
96+
if ($content -match $pattern) {
97+
Write-Verbose " Converting: $oldLink -> $newLink"
98+
$content = $content -replace $pattern, $replacement
99+
$changesMade = $true
100+
}
101+
else {
102+
Write-Verbose " Pattern not found: $pattern"
103+
}
104+
}
105+
106+
# Save the file if changes were made
107+
if ($changesMade) {
108+
Set-Content -Path $filePath -Value $content -NoNewline
109+
Write-Host "Updated: $filePath" -ForegroundColor Green
110+
return $true
111+
}
112+
113+
return $false
114+
}
115+
116+
# Function to validate Hugo links exist
117+
function ValidateHugoLinks {
118+
param([string]$contentDir)
119+
120+
Write-Host "Validating Hugo content structure..." -ForegroundColor Yellow
121+
122+
$missingPages = @()
123+
foreach ($hugoPath in $linkMappings.Values) {
124+
# Convert hugo path to actual file path
125+
$relativePath = $hugoPath -replace '^docs/', ''
126+
$expectedPath = Join-Path $contentDir "docs" ($relativePath -replace '/', '\') "index.md"
127+
if (-not (Test-Path $expectedPath)) {
128+
$missingPages += @{
129+
HugoPath = $hugoPath
130+
ExpectedFile = $expectedPath
131+
}
132+
}
133+
}
134+
135+
if ($missingPages.Count -gt 0) {
136+
Write-Warning "Found $($missingPages.Count) missing Hugo pages:"
137+
foreach ($missing in $missingPages) {
138+
Write-Warning " Hugo path: $($missing.HugoPath)"
139+
Write-Warning " Expected file: $($missing.ExpectedFile)"
140+
}
141+
return $false
142+
}
143+
144+
Write-Host "All Hugo pages exist!" -ForegroundColor Green
145+
return $true
146+
}
147+
148+
# Main execution
149+
Write-Host "Starting Hugo link conversion..." -ForegroundColor Cyan
150+
151+
# Validate that target Hugo pages exist (disabled for now - Hugo will validate during build)
152+
# if (-not (ValidateHugoLinks -contentDir $ContentDir)) {
153+
# Write-Error "Some target Hugo pages are missing. Please ensure all referenced pages exist before running this script."
154+
# exit 1
155+
# }
156+
157+
# Find all markdown files
158+
$markdownFiles = Get-ChildItem -Path $ContentDir -Filter "*.md" -Recurse
159+
160+
Write-Host "Found $($markdownFiles.Count) markdown files to process" -ForegroundColor Yellow
161+
162+
$totalUpdated = 0
163+
164+
# Process each markdown file
165+
foreach ($file in $markdownFiles) {
166+
if (ConvertMarkdownLinksToHugo -filePath $file.FullName -mappings $linkMappings) {
167+
$totalUpdated++
168+
}
169+
}
170+
171+
Write-Host "`nConversion complete!" -ForegroundColor Cyan
172+
Write-Host "Files updated: $totalUpdated" -ForegroundColor Green
173+
174+
# Test Hugo build
175+
Write-Host "`nTesting Hugo build..." -ForegroundColor Yellow
176+
try {
177+
$buildResult = & hugo --source $DocsDir 2>&1
178+
if ($LASTEXITCODE -eq 0) {
179+
Write-Host "Hugo build successful!" -ForegroundColor Green
180+
Write-Host "Build output:" -ForegroundColor Gray
181+
Write-Host $buildResult -ForegroundColor Gray
182+
}
183+
else {
184+
Write-Error "Hugo build failed!"
185+
Write-Host $buildResult -ForegroundColor Red
186+
}
187+
}
188+
catch {
189+
Write-Error "Failed to run Hugo: $($_.Exception.Message)"
190+
}
191+
192+
Write-Host "`nDone! Please review the changes and test your site." -ForegroundColor Cyan

0 commit comments

Comments
 (0)