From 9c36bce963bb6924b8098a43788f700b6e8709b3 Mon Sep 17 00:00:00 2001 From: zivmax Date: Wed, 22 Jan 2025 12:34:16 +0800 Subject: [PATCH] skip relative path logic for 404 pages in post-render hook --- lib/jekyll-theme-cs50.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jekyll-theme-cs50.rb b/lib/jekyll-theme-cs50.rb index fe1680e..ca7f7aa 100644 --- a/lib/jekyll-theme-cs50.rb +++ b/lib/jekyll-theme-cs50.rb @@ -466,6 +466,9 @@ def relative_path(from, to) # For each page site.pages.each do |page| + # Skip relative path logic for 404.md or 404.html + next if page.name == "404.md" || page.name == "404.html" + # If HTML if page.output_ext == ".html"