Sha256: 1e82f7845ff0dcc4da529165aaad8d327aba048c7bc2d04be32bc63fcc8f5056
Contents?: true
Size: 919 Bytes
Versions: 18
Compression:
Stored size: 919 Bytes
Contents
describe 'GH-954', site: true, stdio: true do before do File.write('content/foo.md', 'foo <a href="/">root</a>') File.write('content/bar.md', 'bar <a href="/">root</a>') File.write('content/bar-copy.md', '<%= @items["/bar.*"].compiled_content(snapshot: :last) %>') File.write('Rules', <<EOS) compile '/foo.*' do filter :relativize_paths, type: :html unless rep.path.nil? write item.identifier.without_ext + '.html' end compile '/bar.*' do filter :relativize_paths, type: :html unless rep.path.nil? end compile '/bar-copy.*' do filter :erb write item.identifier.without_ext + '.html' end EOS end it 'properly filters foo.md' do Nanoc::CLI.run(%w(compile)) # Path is relativized expect(File.read('output/foo.html')).to eq('foo <a href="./">root</a>') # Path is not relativized expect(File.read('output/bar-copy.html')).to eq('bar <a href="/">root</a>') end end
Version data entries
18 entries across 18 versions & 1 rubygems