Class: Locomotive::Steam::Adapters::Filesystem::YAMLLoaders::Page
- Inherits:
-
Object
- Object
- Locomotive::Steam::Adapters::Filesystem::YAMLLoaders::Page
- Defined in:
- lib/locomotive/steam/adapters/filesystem/yaml_loaders/page.rb
Instance Attribute Summary
Attributes included from Locomotive::Steam::Adapters::Filesystem::YAMLLoader
Instance Method Summary collapse
-
#load(scope) ⇒ Object
Basically Load all the pages from both the app/views/pages and data/<env>/pages folders.
Methods included from Locomotive::Steam::Adapters::Filesystem::YAMLLoader
#_load, #initialize, #safe_json_file_load, #safe_json_load, #safe_yaml_load, #template_extensions
Instance Method Details
#load(scope) ⇒ Object
Basically Load all the pages from both the app/views/pages and data/<env>/pages folders
The process of loading locally all the pages is pretty complex. Of course, it handles localized pages. It involves 2 main steps.
1/ load all the pages/layouts under app/views/pages. Because of legacy support, we still grab the data from the YAML header.
2/ load the localized content from the data/<env>/pages folder. The content is fetched from the Wagon sync command. 2 kind of pages are stored in this folder:
- pages with a not null handle property. We call them core pages. They are not aimed
to be deleted. When found, we merge their content with the original page found by process #1
- pages without a handle and created from a layout. These pages don't own a liquid template.
We just use the liquid template of the layout they belong to.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/locomotive/steam/adapters/filesystem/yaml_loaders/page.rb', line 26 def load(scope) super @pages_by_fullpath = {} @pages_by_handle = {} # step #1 (cf description of the method) load_tree # step #2 (cf description of the method) load_data @pages_by_fullpath.values end |