class FrontMatterResolverBase

Public Class Methods

new(global_config, type_config, content_item) click to toggle source
# File lib/kontent-jekyll/resolvers/front_matter_resolver.rb, line 2
def initialize(global_config, type_config, content_item)
  @global_config = global_config
  @type_config = type_config
  @content_item = content_item
end

Public Instance Methods

get_element(codename) click to toggle source
# File lib/kontent-jekyll/resolvers/front_matter_resolver.rb, line 31
def get_element(codename)
  @content_item.elements[codename]
end
item() click to toggle source
# File lib/kontent-jekyll/resolvers/front_matter_resolver.rb, line 8
def item
  {
    system: @content_item.system,
    elements: @content_item.elements,
  }
end
layout() click to toggle source

Layout is either specified in the config for this type or global config.

# File lib/kontent-jekyll/resolvers/front_matter_resolver.rb, line 27
def layout
  @type_config&.layout || @global_config.default_layout
end
title() click to toggle source

Title is resolved from the element with 'title' codename or codename specified in the config.

# File lib/kontent-jekyll/resolvers/front_matter_resolver.rb, line 19
def title
  element = get_element(@type_config&.title || 'title')
  element&.value
end