Module: PagesCore::Templates

Defined in:
lib/pages_core/templates.rb,
lib/pages_core/templates/configuration.rb,
lib/pages_core/templates/controller_actions.rb,
lib/pages_core/templates/block_configuration.rb,
lib/pages_core/templates/configuration_proxy.rb,
lib/pages_core/templates/configuration_handler.rb,
lib/pages_core/templates/template_configuration.rb

Defined Under Namespace

Modules: ControllerActions Classes: BlockConfiguration, Configuration, ConfigurationHandler, ConfigurationProxy, TemplateConfiguration

Class Method Summary collapse

Class Method Details

.configurationObject Also known as: config


114
115
116
117
# File 'lib/pages_core/templates/template_configuration.rb', line 114

def configuration
  load_default_configuration unless defined? @configuration
  @configuration
end

.configure(options = {}) {|configuration| ... } ⇒ Object

Yields:


95
96
97
98
99
100
101
102
# File 'lib/pages_core/templates/template_configuration.rb', line 95

def configure(options = {}, &_block)
  if options[:reset] == :defaults
    load_default_configuration
  elsif options[:reset] == true
    @configuration = PagesCore::Templates::Configuration.new
  end
  yield configuration if block_given?
end

.load_default_configurationObject


104
105
106
107
108
109
110
111
112
# File 'lib/pages_core/templates/template_configuration.rb', line 104

def load_default_configuration
  @configuration = PagesCore::Templates::Configuration.new

  # Default template options
  config.default do |default|
    default_configuration(default)
    default_block_configuration(default)
  end
end

.metadata_block_namesObject


120
121
122
123
124
125
# File 'lib/pages_core/templates/template_configuration.rb', line 120

def 
  i[meta_title
     meta_description
     open_graph_title
     open_graph_description]
end

.namesObject


11
12
13
# File 'lib/pages_core/templates.rb', line 11

def names
  @names ||= find_all_templates
end