From 9fbe91deeea4c24152b741dde8c10645f13eb7c2 Mon Sep 17 00:00:00 2001 From: fauno <fauno@endefensadelsl.org> Date: Tue, 23 Jan 2018 13:38:57 -0300 Subject: [PATCH] add base url to relative path for images --- lib/jekyll-pandoc-multiple-formats/pandoc_file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb index a124224..e1fd709 100644 --- a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb +++ b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb @@ -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 @@ -134,7 +133,8 @@ module Jekyll 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)') -- GitLab