Sha256: 4f42e410801696f9213b2903b4d3d661a0af19beb55eebc3b02c9b923cc9becf

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module MetaTagsHelper
  def meta_title
    content_for?(:meta_title) ? content_for(:meta_title) : DEFAULT_META["meta_title"]
  end

  def meta_description
    content_for?(:meta_description) ? content_for(:meta_description) : DEFAULT_META["meta_description"]
  end

  def meta_image
    meta_image = (content_for?(:meta_image) ? content_for(:meta_image) : DEFAULT_META["meta_image"])
    # little twist to make it work equally with an asset or a url
    meta_image.starts_with?("http") ? meta_image : image_url(meta_image)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
seo_optimizer-0.1.2 lib/generators/seo_optimizer/meta_tags/templates/meta_tags_helper.erb
seo_optimizer-0.1.1 lib/generators/seo_optimizer/meta_tags/templates/meta_tags_helper.erb