From 7b384f9bbca3ff7181fe3eddb89bd4585b9486f6 Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Fri, 22 Aug 2025 07:33:37 -0400 Subject: [PATCH] fix(redirects): synchronize netlify and quarto redirect files Corrected a typo in the EPUB path in 'quarto/_redirects' and added missing redirect rules to both 'quarto/_redirects' and 'netlify.toml'. This ensures that the redirect behavior is consistent across both Netlify and direct GitHub Pages access, resolving discrepancies and improving robustness. --- netlify.toml | 10 ++++++++++ quarto/_redirects | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/netlify.toml b/netlify.toml index 4b155f947..d9a6cfa12 100644 --- a/netlify.toml +++ b/netlify.toml @@ -33,11 +33,21 @@ to = "/assets/downloads/Machine-Learning-Systems.pdf" status = 301 +[[redirects]] + from = "/pdf/" + to = "/assets/downloads/Machine-Learning-Systems.pdf" + status = 301 + [[redirects]] from = "/epub" to = "/assets/downloads/Machine-Learning-Systems.epub" status = 301 +[[redirects]] + from = "/epub/" + to = "/assets/downloads/Machine-Learning-Systems.epub" + status = 301 + [[redirects]] from = "/changelog" to = "/contents/frontmatter/changelog/changelog.html" diff --git a/quarto/_redirects b/quarto/_redirects index 46cbc7793..6f22df39a 100644 --- a/quarto/_redirects +++ b/quarto/_redirects @@ -3,12 +3,21 @@ /kits /contents/labs/kits.html 301 /kits/ /contents/labs/kits.html 301 + /labs /contents/labs/labs.html 301 /labs/ /contents/labs/labs.html 301 + /pdf /assets/downloads/Machine-Learning-Systems.pdf 301 -/pdf/ /assets/downloads/Machine-Learning-Systems.pdf 301 -/epub /assets/Machine-Learning-Systems.epub 301 -/epub/ /assets/Machine-Learning-Systems.epub 301 +/pdf/ /assets/downloads/Machine-Learning-Systems.pdf 301 + +/epub /assets/downloads/Machine-Learning-Systems.epub 301 +/epub/ /assets/downloads/Machine-Learning-Systems.epub 301 + +/changelog /contents/frontmatter/changelog/changelog.html 301 +/changelog/ /contents/frontmatter/changelog/changelog.html 301 + +/tinytorch https://mlsysbook.github.io/TinyTorch/intro.html 301 +/tinytorch/ https://mlsysbook.github.io/TinyTorch/intro.html 301 # GitHub Pages fallback: use HTML redirect pages # See kits.html for client-side redirect implementation \ No newline at end of file