Class: Nanoc::DataSources::FilesystemVerbose
- Inherits:
-
Nanoc::DataSource
- Object
- Nanoc::DataSource
- Nanoc::DataSources::FilesystemVerbose
- Includes:
- Filesystem
- Defined in:
- lib/nanoc/data_sources/filesystem_verbose.rb
Overview
The filesystem_verbose data source is the old data source for a new nanoc site. It stores all data as files on the hard disk.
None of the methods are documented in this file. See Nanoc::DataSource for documentation on the overridden methods instead.
The filesystem_verbose data source stores its items and layouts in nested
directories. Each directory represents a single item or layout. The root
directory for items is the content
directory; for layouts it is the
layouts
directory.
Every directory has a content file and a meta file. The content file contains the actual item content, while the meta file contains the item’s or the layout’s metadata, formatted as YAML.
Both content files and meta files are named after its parent directory
(i.e. item). For example, an item/layout named foo
will have a directory
named foo
, with e.g. a foo.markdown
content file and a foo.yaml
meta
file.
Content file extensions are not used for determining the filter that
should be run; the meta file defines the list of filters. The meta file
extension must always be .yaml
, though.
For backwards compatibility, content files can also have the index
basename. Similarly, meta files can have the meta
basename. For example,
a parent directory named foo
can have an index.txt
content file and a
meta.yaml
meta file.
The identifier is calculated by stripping the extension; if there is more than one extension, only the last extension is stripped and the previous extensions will be part of the identifier.
It is possible to set an explicit encoding that should be used when reading
files. In the data source configuration, set encoding
to an encoding
understood by Ruby’s Encoding
. If no encoding is set in the configuration,
one will be inferred from the environment.
Instance Attribute Summary
Attributes included from Filesystem
Attributes inherited from Nanoc::DataSource
#config, #items_root, #layouts_root
Method Summary
Methods included from Filesystem
#content_dir_name, #create_item, #create_layout, #down, #items, #layouts, #layouts_dir_name, #setup, #up
Methods inherited from Nanoc::DataSource
#create_item, #create_layout, #down, #initialize, #items, #layouts, #loading, #setup, #sync, #unuse, #up, #update, #use
Methods included from PluginRegistry::PluginMethods
#all, #identifier, #identifiers, #named, #register
Constructor Details
This class inherits a constructor from Nanoc::DataSource