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:
parent
b7c533b740
commit
6308799fe8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue