fix bug where relative images in previews did not render
This commit is contained in:
+2
-2
@@ -333,9 +333,9 @@ module Gollum
|
||||
# path - The String directory path of the page file.
|
||||
#
|
||||
# Returns the populated Gollum::Page.
|
||||
def populate(blob, path)
|
||||
def populate(blob, path=nil)
|
||||
@blob = blob
|
||||
@path = (path + '/' + blob.name)[1..-1]
|
||||
@path = "#{path}/#{blob.name}"[1..-1]
|
||||
self
|
||||
end
|
||||
|
||||
|
||||
+4
-4
@@ -168,10 +168,10 @@ module Gollum
|
||||
def preview_page(name, data, format)
|
||||
page = @page_class.new(self)
|
||||
ext = @page_class.format_to_ext(format.to_sym)
|
||||
path = @page_class.cname(name) + '.' + ext
|
||||
blob = OpenStruct.new(:name => path, :data => data)
|
||||
page.populate(blob, path)
|
||||
page.version = @access.commit('HEAD')
|
||||
name = @page_class.cname(name) + '.' + ext
|
||||
blob = OpenStruct.new(:name => name, :data => data)
|
||||
page.populate(blob)
|
||||
page.version = @access.commit('master')
|
||||
page
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user