Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aturret committed Jun 4, 2023
1 parent bac84c7 commit 520652a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/jekyll/polyglot/patches/jekyll/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,30 @@ def absolute_url_regex(url, disabled = false)

def relativize_urls(doc, regex)
return if doc.output.nil?

doc.output.gsub(regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
modified_output = doc.output.dup
modified_output.gsub!(regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
doc.output = modified_output
end

def relativize_absolute_urls(doc, regex, url)
return if doc.output.nil?

doc.output.gsub(regex, "href=\"#{url}#{@baseurl}/#{@active_lang}/" + '\1"')
modified_output = doc.output.dup
modified_output.gsub!(regex, "href=\"#{url}#{@baseurl}/#{@active_lang}/" + '\1"')
doc.output = modified_output
end

def correct_nonrelativized_absolute_urls(doc, regex, url)
return if doc.output.nil?

doc.output.gsub(regex, "href=\"#{url}#{@baseurl}/" + '\1"')
modified_output = doc.output.dup
modified_output.gsub!(regex, "href=\"#{url}#{@baseurl}/" + '\1"')
doc.output = modified_output
end

def correct_nonrelativized_urls(doc, regex)
return if doc.output.nil?
modified_output = doc.output.dup
modified_output.gsub!(regex, "href=\"#{@baseurl}/" + '\1"')
doc.output = modified_output
# doc.output.gsub(regex, "href=\"#{@baseurl}/" + '\1"')
end
end
end

0 comments on commit 520652a

Please sign in to comment.