From 6308799fe8466c12979bb13a052ff4f0dc07dcdb Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Tue, 26 Jul 2022 22:14:38 -0700 Subject: [PATCH] handle pretty urls where posts get a directory expect files inside a post to be inside the post's directory rather than in the calendar day's directory --- lib/jekyll-seo-tag/image_drop.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jekyll-seo-tag/image_drop.rb b/lib/jekyll-seo-tag/image_drop.rb index 6e520c7..647ce1f 100644 --- a/lib/jekyll-seo-tag/image_drop.rb +++ b/lib/jekyll-seo-tag/image_drop.rb @@ -66,12 +66,12 @@ module Jekyll def build_absolute_path return raw_path unless raw_path.is_a?(String) && absolute_url?(raw_path) == false + return filters.absolute_url(raw_path) if raw_path.start_with?("/") - if !raw_path.start_with?("/") - return filters.absolute_url File.join(File.dirname(context.registers[:page]["url"]), raw_path) - end + page_dir = @page["url"] + page_dir = File.dirname(page_dir) unless page_dir.end_with?("/") - filters.absolute_url raw_path + filters.absolute_url File.join(page_dir, raw_path) end def filters