gitlink_help_center/fix_image_paths.ps1

17 lines
655 B
PowerShell

# Fix image paths in versioned_docs
$files = Get-ChildItem -Path "versioned_docs/version-1.1.0" -Filter "*.md" -Recurse
foreach ($file in $files) {
$content = Get-Content $file.FullName -Raw -Encoding UTF8
# Fix image paths - replace incorrect formats with correct /img/ format
$content = $content -replace '../../static/img/', '/img/'
$content = $content -replace 'versioned_docs/static/img/', '/img/'
# Write content back to file
[System.IO.File]::WriteAllText($file.FullName, $content, [System.Text.Encoding]::UTF8)
Write-Host "Fixed image paths in: $($file.FullName)"
}
Write-Host "All image paths fixed!"