Sha256: 2c882a50601c27ba8a11fa6dac2c312973fc56cc74b44f3694355cb257117c72
Contents?: true
Size: 621 Bytes
Versions: 27
Compression:
Stored size: 621 Bytes
Contents
# frozen_string_literal: true module Shimmer module MetaHelper def meta @meta ||= Meta.new.tap do |meta| meta.canonical = url_for(only_path: false) end end def title(value) meta.title = value end def description(value) meta.description = value end def image(value) meta.image = image_file_url(value, width: 1200) end def render_meta tags = meta.tags.map do |tag| type = tag.delete(:type) || "meta" value = tag.delete(:value) content_tag(type, value, tag) end safe_join tags, "\n" end end end
Version data entries
27 entries across 27 versions & 1 rubygems