Class | Nanoc::DataSources::Static |
In: |
lib/nanoc/data_sources/static.rb
|
Parent: | Nanoc::DataSource |
The static data source provides items from a single directory. Unlike the filesystem data sources, static provides no additional item metadata. In addition, all items are treated as ‘binary’, regardless of their extension or content. As such, it is most useful for simple assets, not for normal content.
The identifier for static items is the full item path. For example, if your static data source item_root is `static`, an item named `foo.css` would have the identifier `/static/foo.css/`. Note that, unlike the filesystem data sources, `foo/index.html` and `foo.yaml` receive no special treatment. They are simple static items, just like `foo.css`.
The default data source directory is `static/`, but this can be overridden in the data source configuration:
data_sources: - type: static prefix: assets
Unless the `hide_items` configuration attribute is false, items from static data sources will have the :is_hidden attribute set by default, which will exclude them from the Blogging helper‘s atom feed generator, among other things.