Skip to content

Commit

Permalink
add base url to relative path for images
Browse files Browse the repository at this point in the history
  • Loading branch information
fauno committed Jan 23, 2018
1 parent 8c525e4 commit 9fbe91d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module Jekyll
class PandocFile
include Convertible


attr_reader :format, :site, :config, :flags, :posts, :slug, :title, :url
attr_reader :papersize, :sheetsize, :signature

Expand Down Expand Up @@ -134,7 +133,8 @@ def yaml_metadata
end

def content
relative_re = /\(\/(.*)\)/
# add base url from config if we're creating a subdir site
relative_re = /\(#{@site.config.dig('baseurl')}\/(.*)\)/
if single_post?
# make all images relative to source dir
single_post.content.gsub(relative_re, '(\1)')
Expand Down

0 comments on commit 9fbe91d

Please sign in to comment.