From e4e5186f8c15e6c503f00ed1c1a389f32d5181cf Mon Sep 17 00:00:00 2001 From: Dana Merrick Date: Sat, 30 Jan 2021 17:36:01 -0500 Subject: [PATCH 1/3] Fixing content type --- config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.rb b/config.rb index 8bb5fe1..b136164 100644 --- a/config.rb +++ b/config.rb @@ -29,7 +29,7 @@ #TODO: add something like this to speed it up? # next if sitemap.find_resource_by_path(...) short_path = img.destination_path.sub(/#{File.extname(img.destination_path)}$/, '') - proxy short_path, "/photo.html", layout: 'layout', locals: { photo: img }, ignore: true + proxy short_path, '/photo.html', layout: 'layout', locals: { photo: img }, ignore: true, content_type: 'text/html' end end From 517131a191408046e9cb18858ee2730c773ca408 Mon Sep 17 00:00:00 2001 From: Dana Merrick Date: Sat, 30 Jan 2021 17:51:24 -0500 Subject: [PATCH 2/3] This maybe? --- config.rb | 3 +-- helpers/dana_lol_helpers.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config.rb b/config.rb index b136164..c5b8dd2 100644 --- a/config.rb +++ b/config.rb @@ -28,8 +28,7 @@ images.each do |img| #TODO: add something like this to speed it up? # next if sitemap.find_resource_by_path(...) - short_path = img.destination_path.sub(/#{File.extname(img.destination_path)}$/, '') - proxy short_path, '/photo.html', layout: 'layout', locals: { photo: img }, ignore: true, content_type: 'text/html' + proxy img.destination_path, '/photo.html', layout: 'layout', locals: { photo: img }, ignore: true end end diff --git a/helpers/dana_lol_helpers.rb b/helpers/dana_lol_helpers.rb index 154827a..72cf0be 100644 --- a/helpers/dana_lol_helpers.rb +++ b/helpers/dana_lol_helpers.rb @@ -8,7 +8,7 @@ def newthought(content) alias_method :nt, :newthought def linked_image(img_src, alt_text = '') - link_to(image_tag(img_src, alt: alt_text), remove_file_extension(img_src), class: 'no-underline') + link_to(image_tag(img_src, alt: alt_text), img_src, class: 'no-underline') end # used for images and other figures From 1500e04823b784170248f77e7305aaf7d93f8f1e Mon Sep 17 00:00:00 2001 From: Dana Merrick Date: Sat, 30 Jan 2021 17:51:31 -0500 Subject: [PATCH 3/3] Revert "This maybe?" This reverts commit 517131a191408046e9cb18858ee2730c773ca408. --- config.rb | 3 ++- helpers/dana_lol_helpers.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.rb b/config.rb index c5b8dd2..b136164 100644 --- a/config.rb +++ b/config.rb @@ -28,7 +28,8 @@ images.each do |img| #TODO: add something like this to speed it up? # next if sitemap.find_resource_by_path(...) - proxy img.destination_path, '/photo.html', layout: 'layout', locals: { photo: img }, ignore: true + short_path = img.destination_path.sub(/#{File.extname(img.destination_path)}$/, '') + proxy short_path, '/photo.html', layout: 'layout', locals: { photo: img }, ignore: true, content_type: 'text/html' end end diff --git a/helpers/dana_lol_helpers.rb b/helpers/dana_lol_helpers.rb index 72cf0be..154827a 100644 --- a/helpers/dana_lol_helpers.rb +++ b/helpers/dana_lol_helpers.rb @@ -8,7 +8,7 @@ def newthought(content) alias_method :nt, :newthought def linked_image(img_src, alt_text = '') - link_to(image_tag(img_src, alt: alt_text), img_src, class: 'no-underline') + link_to(image_tag(img_src, alt: alt_text), remove_file_extension(img_src), class: 'no-underline') end # used for images and other figures