File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 55 next unless doc . output_ext == ".html"
66
77 site = doc . site
8- baseurl = site . config [ "baseurl" ] . to_s
98 liquid_context = Liquid ::Context . new ( { } , { } , { site : site } )
109
1110 process_uri = lambda do |path |
1211 uri = Addressable ::URI . parse ( path )
13- if uri &.path && ! uri . path &. start_with? ( baseurl )
12+ if uri &.path
1413 uri . path = Liquid ::Template . parse ( "{% link #{ uri . path [ 1 ..] } %}" ) . render! ( liquid_context )
1514 end
1615 uri . to_s
1716 end
1817
1918 fragment = Nokogiri ::HTML ::DocumentFragment . parse ( doc . content )
20- fragment . css ( "[src^=\" /\" ]" ) . each do |item |
19+ fragment . css ( "[src^=\" /assets/ \" ],[src^= \" / \" ][src$= \" .md \" ],[src^= \" / \" ][src*= \" .md# \" ]" ) . each do |item |
2120 if item [ "src" ]
2221 item [ "src" ] = process_uri . call ( item [ "src" ] )
2322 end
2423 end
25- fragment . css ( "[href^=\" /\" ]" ) . each do |item |
24+ fragment . css ( "[href^=\" /assets/ \" ],[href^= \" / \" ][href$= \" .md \" ],[href^= \" / \" ][href*= \" .md# \" ]" ) . each do |item |
2625 if item [ "href" ]
2726 item [ "href" ] = process_uri . call ( item [ "href" ] )
2827 end
You can’t perform that action at this time.
0 commit comments