Class | Nanoc::Site |
In: |
lib/nanoc/base/source_data/site.rb
lib/nanoc/helpers/capturing.rb |
Parent: | Object |
The in-memory representation of a nanoc site. It holds references to the following site data:
In addition, each site has a {config} hash which stores the site configuration.
The physical representation of a {Nanoc::Site} is usually a directory that contains a configuration file, site data, a rakefile, a rules file, etc. The way site data is stored depends on the data source.
DEFAULT_DATA_SOURCE_CONFIG | = | { :type => 'filesystem_unified', :items_root => '/', :layouts_root => '/', :config => {} | The default configuration for a data source. A data source‘s configuration overrides these options. | |
DEFAULT_CONFIG | = | { :text_extensions => %w( css erb haml htm html js less markdown md php rb sass scss txt xhtml xml coffee hb handlebars mustache ms ).sort, :output_dir => 'output', :data_sources => [ {} ], :index_filenames => [ 'index.html' ], :enable_output_diff => false, :prune => { :auto_prune => false, :exclude => [ '.git', '.hg', '.svn', 'CVS' ] } | The default configuration for a site. A site‘s configuration overrides these options: when a {Nanoc::Site} is created with a configuration that lacks some options, the default value will be taken from `DEFAULT_CONFIG`. |
@return [Boolean] true if the current working directory is a nanoc site, false otherwise
@api private
Returns this site’s code snippets.
@return [Array<Nanoc::CodeSnippet>] The list of code snippets in this
site
Returns the compiler for this site. Will create a new compiler if none exists yet.
@return [Nanoc::Compiler] The compiler for this site
Returns the site configuration. It has the following keys:
The list of data sources consists of hashes with the following keys:
@return [Hash] The site configuration
Returns the data sources for this site. Will create a new data source if none exists yet.
@return [Array<Nanoc::DataSource>] The list of data sources for this
site
@raise [Nanoc::Errors::UnknownDataSource] if the site configuration
specifies an unknown data source
Loads the site data. It is not necessary to call this method explicitly; it will be called when it is necessary.
@api private
@return [void]
@deprecated It is no longer necessary to explicitly load site data. It
is safe to remove all {#load_data} calls.
Fills each item‘s parent reference and children array with the appropriate items. It is probably not necessary to call this method manually; it will be called when appropriate.
@return [void]