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
|
||||
$relPath = $htmlFile.Substring($wikiFull.Length).TrimStart('\','/')
|
||||
|
||||
# Normalize path separators to forward slashes for URLs
|
||||
$relPath = $relPath -replace '\\', '/'
|
||||
|
||||
$filename = [System.IO.Path]::GetFileNameWithoutExtension($htmlFile)
|
||||
|
||||
# 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
|
||||
$relativeUrl = '../' + $relPath
|
||||
|
||||
# URL-encode spaces and special chars
|
||||
Add-Type -AssemblyName System.Web
|
||||
$encodedUrl = [System.Web.HttpUtility]::UrlEncode($relativeUrl)
|
||||
# URL-encode spaces but keep forward slashes
|
||||
$encodedUrl = $relativeUrl -replace ' ', '%20'
|
||||
|
||||
$redirectHtml = @"
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -137,7 +137,7 @@ def scan_folder(folder: Path, base_path: Path) -> list:
|
||||
for md_file in md_files:
|
||||
title = get_file_title(md_file)
|
||||
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
|
||||
for subfolder in subfolders:
|
||||
|
||||
Reference in New Issue
Block a user