Class: Nanoc3::DataSources::FilesystemUnified

### Home Classes Methods

### In Files

- lib/nanoc3/data_sources/filesystem_unified.rb

### Parent

Nanoc3::DataSource

### Included Modules

- Nanoc3::DataSources::Filesystem

### Files

- ChangeLog
- LICENSE

### Class/Module Index

Quicksearch

- Nanoc3
- Nanoc3::ArrayExtensions
- Nanoc3::CLI
- Nanoc3::CLI::Base
- Nanoc3::CLI::Commands
- Nanoc3::CLI::Commands::Autocompile
- Nanoc3::CLI::Commands::Compile
- Nanoc3::CLI::Commands::CreateItem
- Nanoc3::CLI::Commands::CreateLayout
- Nanoc3::CLI::Commands::CreateSite
- Nanoc3::CLI::Commands::Debug
- Nanoc3::CLI::Commands::Help
- Nanoc3::CLI::Commands::Info
- Nanoc3::CLI::Commands::Update
- Nanoc3::CLI::Commands::View
- Nanoc3::CLI::Logger
- Nanoc3::CodeSnippet
- Nanoc3::Compiler
- Nanoc3::CompilerDSL
- Nanoc3::Context
- Nanoc3::DataSource
- Nanoc3::DataSources
- Nanoc3::DataSources::Delicious
- Nanoc3::DataSources::Filesystem
- Nanoc3::DataSources::FilesystemCombined
- Nanoc3::DataSources::FilesystemCompact
- Nanoc3::DataSources::FilesystemUnified
- Nanoc3::DataSources::FilesystemVerbose
- Nanoc3::DataSources::LastFM
- Nanoc3::DataSources::Twitter
- Nanoc3::DependencyTracker
- Nanoc3::DirectedGraph
- Nanoc3::Errors
- Nanoc3::Errors::CannotDetermineFilter
- Nanoc3::Errors::CannotLayoutBinaryItem
- Nanoc3::Errors::CannotUseBinaryFilter
- Nanoc3::Errors::CannotUseTextualFilter
- Nanoc3::Errors::DataNotYetAvailable
- Nanoc3::Errors::Generic
- Nanoc3::Errors::NoMatchingCompilationRuleFound
- Nanoc3::Errors::NoMatchingRoutingRuleFound
- Nanoc3::Errors::NoRulesFileFound
- Nanoc3::Errors::RecursiveCompilation
- Nanoc3::Errors::UnknownDataSource
- Nanoc3::Errors::UnknownFilter
- Nanoc3::Errors::UnknownLayout
- Nanoc3::Errors::UnmetDependency
- Nanoc3::Extra
- Nanoc3::Extra::AutoCompiler
- Nanoc3::Extra::CHiCk
- Nanoc3::Extra::CHiCk::CacheController
- Nanoc3::Extra::CHiCk::Client
- Nanoc3::Extra::CHiCk::RackClient
- Nanoc3::Extra::Context
- Nanoc3::Extra::Deployers
- Nanoc3::Extra::Deployers::Rsync
- Nanoc3::Extra::FileProxy
- Nanoc3::Extra::TimeExtensions
- Nanoc3::Extra::VCS
- Nanoc3::Extra::VCSes
- Nanoc3::Extra::VCSes::Bazaar
- Nanoc3::Extra::VCSes::Dummy
- Nanoc3::Extra::VCSes::Git
- Nanoc3::Extra::VCSes::Mercurial
- Nanoc3::Extra::VCSes::Subversion
- Nanoc3::Extra::Validators
- Nanoc3::Extra::Validators::Links
- Nanoc3::Extra::Validators::Links::EachPairEnumerator
- Nanoc3::Extra::Validators::W3C
- Nanoc3::Filter
- Nanoc3::Filters
- Nanoc3::Filters::BlueCloth
- Nanoc3::Filters::CodeRay
- Nanoc3::Filters::ColorizeSyntax
- Nanoc3::Filters::ERB
- Nanoc3::Filters::Erubis
- Nanoc3::Filters::Haml
- Nanoc3::Filters::Kramdown
- Nanoc3::Filters::Less
- Nanoc3::Filters::Markaby
- Nanoc3::Filters::Maruku
- Nanoc3::Filters::RDiscount
- Nanoc3::Filters::RDoc
- Nanoc3::Filters::Rainpress
- Nanoc3::Filters::RedCloth
- Nanoc3::Filters::RelativizePaths
- Nanoc3::Filters::RubyPants
- Nanoc3::Filters::Sass
- Nanoc3::HashExtensions
- Nanoc3::Helpers
- Nanoc3::Helpers::Blogging
- Nanoc3::Helpers::Breadcrumbs
- Nanoc3::Helpers::Capturing
- Nanoc3::Helpers::Filtering
- Nanoc3::Helpers::HTMLEscape
- Nanoc3::Helpers::LinkTo
- Nanoc3::Helpers::Rendering
- Nanoc3::Helpers::Tagging
- Nanoc3::Helpers::Text
- Nanoc3::Helpers::XMLSitemap
- Nanoc3::Item
- Nanoc3::ItemRep
- Nanoc3::Layout
- Nanoc3::NotificationCenter
- Nanoc3::PluginRegistry
- Nanoc3::PluginRegistry::PluginMethods
- Nanoc3::Rule
- Nanoc3::RuleContext
- Nanoc3::Site
- Nanoc3::StringExtensions
- Nanoc3::Tasks
- Nanoc3::Tasks::Clean
- Array
- Enumerable
- Hash
- Object
- OrderedHash
- String
- Time

No matching classes.

# Nanoc3::DataSources::FilesystemUnified

The filesystem_unified data source stores its items and layouts in nested directories. Items and layouts are represented by one or two files; if it is represented using one file, the metadata can be contained in this file. The root directory for items is the `content` directory; for layouts, this is the `layouts` directory.

The metadata for items and layouts can be stored in a separate file with the same base name but with the `.yaml` extension. If such a file is found, metadata is read from that file. Alternatively, the content file itself can start with a metadata section: it can be stored at the top of the file, between `—` (three dashes) separators. For example:

    ---
    title: "Moo!"
    ---
    h1. Hello!

The metadata section can be omitted. If the file does not start with three or five dashes, the entire file will be considered as content.

The identifier of items and layouts is determined as follows. A file with an `index.*` filename, such as `index.txt`, will have the filesystem path with the `index.*` part stripped as a identifier. For example:

    foo/bar/index.html → /foo/bar/

In other cases, the identifier is calculated by stripping the extension. If the `allow_periods_in_identifiers` attribute in the configuration is true, only the last extension will be stripped if the file has multiple extensions; if it is false or unset, all extensions will be stripped. For example:

    (`allow_periods_in_identifiers` set to true)
    foo.entry.html → /foo.entry/

    (`allow_periods_in_identifiers` set to false)
    foo.html.erb → /foo/

Note that it is possible for two different, separate files to have the same identifier. It is recommended to avoid such situations.

Some more examples:

    content/index.html          → /
    content/foo.html            → /foo/
    content/foo/index.html      → /foo/
    content/foo/bar.html        → /foo/bar/
    content/foo/bar.baz.html    → /foo/bar/ OR /foo/bar.baz/
    content/foo/bar/index.html  → /foo/bar/
    content/foo.bar/index.html  → /foo.bar/

The file extension does not determine the filters to run on items; the Rules file is used to specify processing instructors for each item.

[Validate]

Generated with the Darkfish Rdoc Generator 2.