Class: Stic::File

Inherits:
Blob
  • Object
show all
Includes:
Readable
Defined in:
lib/stic/file.rb

Overview

Represent an output blob containing data from a single source file.

Subclasses can override the ‘render` method to implement processing logic.

Direct Known Subclasses

Page

Instance Attribute Summary

Attributes included from Readable

#name, #path, #source

Attributes included from SiteBase

#data, #site

Instance Method Summary collapse

Methods included from Readable

#content, #initialize, #read, #render, #source_path

Methods inherited from Blob

#mime_type, #relative_target_path, #relative_url, #target_path, #to_s, #write

Methods included from SiteBase

#initialize

Instance Method Details

#url_templatePath

Return site relative URL.

File blobs do not have a variable URL template by default so the #url_template is equal the Blob#relative_url and consists of the blob Readable#path and the blob file Readable#name.

As subclasses can override #url_template with custom behavior the file blob class does not override the placeholder replacement login in Blob#relative_url but #url_template that returns a URL without placeholders.

Returns:

  • (Path)

    Relative blob URL.

See Also:

  • Blob#url_template


27
28
29
# File 'lib/stic/file.rb', line 27

def url_template
  path.dirname.join(name).as_absolute
end