mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-26 14:46:11 +00:00
Updated Wiki content
@@ -147,6 +147,9 @@ Get-ChildItem -Path wiki -Filter *.html -Recurse | Where-Object { $_.Name -ne 'i
|
|||||||
# Calculate relative path from wiki/ to the current HTML file
|
# Calculate relative path from wiki/ to the current HTML file
|
||||||
$relPath = $htmlFile.Substring($wikiFull.Length).TrimStart('\','/')
|
$relPath = $htmlFile.Substring($wikiFull.Length).TrimStart('\','/')
|
||||||
|
|
||||||
|
# Normalize path separators to forward slashes for URLs
|
||||||
|
$relPath = $relPath -replace '\\', '/'
|
||||||
|
|
||||||
$filename = [System.IO.Path]::GetFileNameWithoutExtension($htmlFile)
|
$filename = [System.IO.Path]::GetFileNameWithoutExtension($htmlFile)
|
||||||
|
|
||||||
# Skip if the file is already at the root of wiki/
|
# Skip if the file is already at the root of wiki/
|
||||||
@@ -167,9 +170,8 @@ Get-ChildItem -Path wiki -Filter *.html -Recurse | Where-Object { $_.Name -ne 'i
|
|||||||
# Relative URL: go up one level then down to the original file
|
# Relative URL: go up one level then down to the original file
|
||||||
$relativeUrl = '../' + $relPath
|
$relativeUrl = '../' + $relPath
|
||||||
|
|
||||||
# URL-encode spaces and special chars
|
# URL-encode spaces but keep forward slashes
|
||||||
Add-Type -AssemblyName System.Web
|
$encodedUrl = $relativeUrl -replace ' ', '%20'
|
||||||
$encodedUrl = [System.Web.HttpUtility]::UrlEncode($relativeUrl)
|
|
||||||
|
|
||||||
$redirectHtml = @"
|
$redirectHtml = @"
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ def scan_folder(folder: Path, base_path: Path) -> list:
|
|||||||
for md_file in md_files:
|
for md_file in md_files:
|
||||||
title = get_file_title(md_file)
|
title = get_file_title(md_file)
|
||||||
rel_path = md_file.relative_to(base_path)
|
rel_path = md_file.relative_to(base_path)
|
||||||
nav_items.append((title, str(rel_path)))
|
nav_items.append((title, str(rel_path).replace('\\', '/')))
|
||||||
|
|
||||||
# Process subfolders recursively
|
# Process subfolders recursively
|
||||||
for subfolder in subfolders:
|
for subfolder in subfolders:
|
||||||
|
|||||||
Reference in New Issue
Block a user