Sha256: ea93cb6a1b7732d763686e13a10e5379a7cc5f07fc2e195a0b198b0fa0911f5f

Contents?: true

Size: 774 Bytes

Versions: 4

Compression:

Stored size: 774 Bytes

Contents

module Blogit
  
  module LayoutHelper

    # Sets or returns the title for a page
    #
    # content - The content to include in the HTML title tag.
    #
    # Returns a String
    def title(content=nil)
      if content
        content_for(:title, content)
      else
        content_for(:title)
      end
    end
    
    # Sets or returns the description for a page. Formats the content if it's Markdown or
    # HTML and strips out the HTML tags.
    #
    # content - The content to include in the HTML meta description tag.
    #
    # Returns a String    
    def description(content=nil)
      if content
        content_for(:description, strip_tags(format_content(content)).html_safe)
      else
        content_for(:description)
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blogit-1.1.2 app/helpers/blogit/layout_helper.rb
blogit-1.1.1 app/helpers/blogit/layout_helper.rb
blogit-1.1.0 app/helpers/blogit/layout_helper.rb
blogit-1.0.0 app/helpers/blogit/layout_helper.rb