-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-urls-for-github-pages.ps1
More file actions
47 lines (37 loc) · 1.5 KB
/
update-urls-for-github-pages.ps1
File metadata and controls
47 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Update Website URLs for GitHub Pages
# Usage: .\update-urls-for-github-pages.ps1 [-CustomDomain "persistenceai.com"]
param(
[string]$CustomDomain = "",
[string]$GitHubPagesUrl = "https://persistence-ai.github.io/Landi"
)
$ErrorActionPreference = "Stop"
# Determine base URL
$BaseUrl = if ($CustomDomain) {
"https://$CustomDomain"
} else {
$GitHubPagesUrl
}
Write-Host "Updating website URLs to: $BaseUrl" -ForegroundColor Cyan
$indexHtml = "index.html"
if (-not (Test-Path $indexHtml)) {
Write-Error "index.html not found in current directory"
exit 1
}
# Read file
$content = Get-Content $indexHtml -Raw
# Replace all instances of persistenceai.com with the base URL
$content = $content -replace 'https://persistenceai\.com', $BaseUrl
$content = $content -replace 'https://api\.persistenceai\.com', "$BaseUrl/api"
# Write back
Set-Content -Path $indexHtml -Value $content -NoNewline
Write-Host "✅ Updated all URLs in index.html" -ForegroundColor Green
Write-Host ""
Write-Host "Updated URLs:" -ForegroundColor Yellow
Write-Host " Install: $BaseUrl/install" -ForegroundColor White
Write-Host " Download: $BaseUrl/download" -ForegroundColor White
Write-Host " API: $BaseUrl/api" -ForegroundColor White
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Yellow
Write-Host " 1. Review index.html to verify changes" -ForegroundColor White
Write-Host " 2. Update install.ps1 and install.sh base URLs" -ForegroundColor White
Write-Host " 3. Commit and push to GitHub" -ForegroundColor White