Skip to content

Commit

Permalink
Trying to fix the broken install links
Browse files Browse the repository at this point in the history
  • Loading branch information
on committed Oct 3, 2025
1 parent e07982f commit 859a97c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/generate-readme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ foreach ($file in $userJsFiles) {
$scriptList += " - **Install:** "
if ($autoUpdate) { $color = "green" } else { $color = "blue" }
# Get the relative path from the root, replacing backslashes with forward slashes for URLs
$relativePath = $file.FullName.Replace($rootDir + "\", "").Replace("\", "/")
$relativePath = [System.IO.Path]::GetRelativePath($rootDir, $file.FullName).Replace("\", "/")
$scriptList += New-MDImage -Subject "$($file.Name)" -Status "$version" -Color $color -Link "https://git.ntnu.no/M365-Drift/MonkeyMagic/raw/main/$relativePath"
if ($author) {
$scriptList += "`n - **Author:** $author`n"
Expand Down Expand Up @@ -140,7 +140,7 @@ foreach ($file in $userJsFiles) {
$extraDoc = Get-Content $docFile -Raw

# Replace relative image links with absolute links from the script's subfolder
$relativeScriptPath = $currentScriptDir.Replace($rootDir + "\", "").Replace("\", "/")
$relativeScriptPath = [System.IO.Path]::GetRelativePath($rootDir, $currentScriptDir).Replace("\", "/")
# Replace relative image links (simple filenames with common image extensions)
$extraDoc = $extraDoc -replace '\!\[([^\]]+)\]\(([^/)]+\.(gif|png|jpg|jpeg|webp|svg))\)', "![`$1]($relativeScriptPath/`$2)"

Expand Down

0 comments on commit 859a97c

Please sign in to comment.