Sha256: bfa03c75d59edeae5e8c7ee98bcac9ca6469c41a595dc7fef7b3187fc6b0c91b

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

module Trestle
  module TitleHelper
    def trestle_title
      if Trestle.config.site_logo
        if Trestle.config.site_logo_small
          safe_join([
            image_tag(Trestle.config.site_logo, class: "visible-xs-inline visible-lg-inline", alt: Trestle.config.site_title),
            image_tag(Trestle.config.site_logo_small, class: "visible-sm-inline visible-md-inline", alt: Trestle.config.site_title)
          ], "\n")
        else
          image_tag(Trestle.config.site_logo)
        end
      elsif Trestle.config.site_logo_small
        safe_join([
          image_tag(Trestle.config.site_logo_small, alt: ""),
          content_tag(:span, Trestle.config.site_title, class: "visible-xs-inline visible-lg-inline")
        ], "\n")
      else
        safe_join([
          content_tag(:span, Trestle.config.site_title, class: "visible-xs-inline visible-lg-inline"),
          content_tag(:span, Trestle.config.site_title.split(/ /).map(&:first).first(3).join, class: "visible-sm-inline visible-md-inline")
        ], "\n")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trestle-0.8.9 app/helpers/trestle/title_helper.rb
trestle-0.8.8 app/helpers/trestle/title_helper.rb
trestle-0.8.7 app/helpers/trestle/title_helper.rb
trestle-0.8.6 app/helpers/trestle/title_helper.rb
trestle-0.8.5 app/helpers/trestle/title_helper.rb
trestle-0.8.4 app/helpers/trestle/title_helper.rb
trestle-0.8.3 app/helpers/trestle/title_helper.rb
trestle-0.8.2 app/helpers/trestle/title_helper.rb
trestle-0.8.0 app/helpers/trestle/title_helper.rb