Fix gallery image paths to be relative to HTML output
Assisted-by: Claude Opus 4.6 via Claude Code
change zxlspossznwzwwtyorwmxzkpynxmqsqy
commit 5081195820e006c71fbb542a2085602572334cab
author Alpha Chen <alpha@kejadlen.dev>
date
parent tmkqvopo
diff --git a/Rakefile b/Rakefile
index a653d20..e59e04a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -191,8 +191,9 @@ namespace :snapshots do
     css_sources.each_key { |src| cp src, output_dir }
 
     title = "Ketchup Snapshots"
+    images_rel = Pathname.new(images_dir).relative_path_from(Pathname.new(output_dir))
     images = Dir.glob(File.join(images_dir, "*.png")).sort.map do |f|
-      { name: File.basename(f, ".png"), filename: File.basename(f) }
+      { name: File.basename(f, ".png"), filename: File.join(images_rel, File.basename(f)) }
     end
 
     template = File.read(File.expand_path("templates/snapshot_gallery.erb", __dir__))