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
This commit is contained in:
Andre Arko 2022-07-26 22:14:38 -07:00
parent b7c533b740
commit 6308799fe8
No known key found for this signature in database
GPG Key ID: BBE521252B9D156A
1 changed files with 4 additions and 4 deletions

View File

@ -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