Sha256: 21a15a638a17ea807e92a67934776e51832dd9cee6e56a1e20005a99510d80e5

Contents?: true

Size: 568 Bytes

Versions: 4

Compression:

Stored size: 568 Bytes

Contents

module Enki
  module PageTitleHelper
    def posts_title(tag)
      compose_title((tag || "").to_s.titleize)
    end

    def post_title(post)
      compose_title(post.title)
    end

    def archives_title
      compose_title("Archives")
    end

    def page_title(page)
      compose_title(page.title)
    end

    def html_title(content)
      if content.present?
        content
      else
        Enki.config[:title]
      end
    end

    private

    def compose_title(*parts)
      (parts << Enki.config[:title]).reject(&:blank?).join(" - ")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enki-engine-0.0.5 app/helpers/enki/page_title_helper.rb
enki-engine-0.0.4 app/helpers/enki/page_title_helper.rb
enki-engine-0.0.3 app/helpers/enki/page_title_helper.rb
enki-engine-0.0.2 app/helpers/enki/page_title_helper.rb