From 8899db7a3c0ade161b31f17592c58b8f25af9f73 Mon Sep 17 00:00:00 2001 From: Fatih Guner Date: Sat, 15 Aug 2026 13:44:31 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20/kutuphane=20404=20=E2=80=94=20slug/inde?= =?UTF-8?q?x=20sayfalar=C4=B1=20=C3=BCst=20dizinde=20de=20sunulsun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mintlify 'slug/index' sayfasını /slug'da sunar; export sadece slug/index/index.html üretir, iç linkler /slug'a gider → 404. Post-process kopyasıyla iki URL de çalışıyor. - Build temizliği export öncesine alındı (dist/dist kontaminasyonu) - .mintignore: dist/, export.zip, scripts/ eklendi - Export'a sızan repo scripts/ dizini dist'ten siliniyor Co-Authored-By: Claude Fable 5 --- .mintignore | 5 +++++ scripts/build-static.sh | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.mintignore b/.mintignore index c27b540..95c10ee 100644 --- a/.mintignore +++ b/.mintignore @@ -22,3 +22,8 @@ CODE_OF_CONDUCT.md CLAUDE.md MEMORY.md .github/ + +# Statik export build çıktıları — export'a sızmasın +dist/ +export.zip +scripts/ diff --git a/scripts/build-static.sh b/scripts/build-static.sh index 5d59449..00c12ac 100755 --- a/scripts/build-static.sh +++ b/scripts/build-static.sh @@ -6,9 +6,12 @@ set -euo pipefail SITE_URL="${SITE_URL:-https://harness.komunite.com.tr}" +# Önceki build kalıntıları export'a "statik asset" olarak sızmasın +# diye temizlik export'tan ÖNCE yapılır (dist/dist kontaminasyonu). +rm -rf dist export.zip + npx -y mint export --output export.zip -rm -rf dist mkdir dist if command -v unzip >/dev/null 2>&1; then unzip -oq export.zip -d dist @@ -21,6 +24,15 @@ rm -f export.zip # Local önizleme yardımcıları hosting'de gereksiz. rm -f dist/serve.js "dist/Start Docs.bat" "dist/Start Docs.command" +rm -rf dist/scripts + +# Mintlify "slug/index" sayfalarını "/slug" URL'inde sunar; export ise +# sadece "slug/index/index.html" üretir ve iç linkler "/slug"a işaret +# eder. Sayfayı bir üst dizine kopyalayarak iki URL'i de çalıştır. +find dist -mindepth 2 -type d -name index | while IFS= read -r d; do + parent=$(dirname "$d") + [ -f "$parent/index.html" ] || cp "$d/index.html" "$parent/index.html" +done # Export, custom domain'i bilmediği için OG/canonical URL'lerini # undefined.mintlify.app olarak basıyor; gerçek domain ile değiştir.