You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
♻️ (ImagesToBlobStorage.ps1, Sync-BlobStorageImages.ps1): refactor
logging and improve URL handling logic
Refactor the logging mechanism to use `Write-InfoLog` instead of
`Write-Host` for better log management and consistency. Enhance the URL
handling logic in `Rewrite-ImageLinks` to ensure paths are correctly
updated only when they match the allowed pattern. This change improves
the clarity and maintainability of the script by ensuring that only
valid URLs are processed and others are logged for debugging.
Copy file name to clipboardexpand all lines: .powershell/dev/Sync-BlobStorageImages.ps1
+12-4
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,26 @@
2
2
3
3
. ./.powershell/_includes/ImagesToBlobStorage.ps1
4
4
5
-
Write-Host"Starting process..."
5
+
#Write-InfoLog "Remove existing public content..."
6
+
#Remove-Item -Path .\public\* -Recurse -Force
7
+
Write-InfoLog"Build new public content.."
8
+
#hugo --source site --config "hugo.yaml, hugo.local.yaml"
9
+
Write-InfoLog"Starting process..."
10
+
11
+
6
12
7
13
# Variables
8
14
if (-not$env:LOCAL_IMAGE_PATH) {
9
15
$env:LOCAL_IMAGE_PATH=".\public\resources\blog\announcing-evidence-based-management-training-with-certification-from-scrum-org\"# Local folder containing images and HTML files
$env:BLOB_URL_BIT="https://nkdagilityblobs.blob.core.windows.net/`$web"#"/blob" # URL to be used for rewriting - can be full URL or "blob" for relative paths
15
22
}
16
-
Write-Host"Blob URL Bit: $env:BLOB_URL_BIT"
23
+
Write-InfoLog"Blob URL Bit: $env:BLOB_URL_BIT"
24
+
17
25
if (-not$env:BLOB_STORAGE_URL) {
18
26
$env:BLOB_STORAGE_URL="https://nkdagilityblobs.blob.core.windows.net/`$web"# Base URL for Blob storage
0 commit comments