Class: Nanoc3::PreprocessorContext
Nanoc3::PreprocessorContext provides a context in which preprocessing code can be executed. It provides access to the site and its configuration, items and layouts.
Constructor Summary
Creates a new preprocessor context for the given site.
9 10 11 |
# File 'lib/nanoc3/base/preprocessor_context.rb', line 9 def initialize(site) @site = site end |
Public Visibility
Public Instance Method Summary
| #config |
The configuration of the site for which the preprocessor code is being executed. |
|---|---|
| #items |
The items in the site for which the preprocessor code is being executed. |
| #layouts |
The layouts in the site for which the preprocessor code is being executed. |
| #site |
The site for which the preprocessor code is being executed. |
Public Instance Method Details
config
The configuration of the site for which the preprocessor code is being executed.
20 21 22 |
# File 'lib/nanoc3/base/preprocessor_context.rb', line 20 def config site.config end |
items
The items in the site for which the preprocessor code is being executed.
25 26 27 |
# File 'lib/nanoc3/base/preprocessor_context.rb', line 25 def items site.items end |
layouts
The layouts in the site for which the preprocessor code is being executed.
31 32 33 |
# File 'lib/nanoc3/base/preprocessor_context.rb', line 31 def layouts site.layouts end |
site
The site for which the preprocessor code is being executed.
14 15 16 |
# File 'lib/nanoc3/base/preprocessor_context.rb', line 14 def site @site end |