Class: Lifer::URIStrategy::Root

Inherits:
Lifer::URIStrategy show all
Defined in:
lib/lifer/uri_strategy/root.rb

Overview

No matter what collection an entry is in, this URI strategy ensures that the entries are output to the root of the output directory (for example: ‘_build/<your-entry>.html`, never `_build/collection_name/<your-entry>.html`.

Instance Attribute Summary

Attributes inherited from Lifer::URIStrategy

#root

Instance Method Summary collapse

Methods inherited from Lifer::URIStrategy

#initialize

Constructor Details

This class inherits a constructor from Lifer::URIStrategy

Instance Method Details

#output_file(entry) ⇒ Object



10
11
12
13
14
15
# File 'lib/lifer/uri_strategy/root.rb', line 10

def output_file(entry)
  basename = File.basename entry.file,
    Lifer::Utilities.file_extension(entry.file)

  Pathname "#{basename}.#{file_extension(entry)}"
end