Module: Hightouch::HelperMethods

Includes:
ArchivePageGenerator
Defined in:
lib/hightouch.rb

Instance Method Summary collapse

Methods included from ArchivePageGenerator

#generate_archive_pages

Instance Method Details

#blogObject



36
37
38
# File 'lib/hightouch.rb', line 36

def blog
  @blog ||= Blog.new(self)
end

#font_size_for_tag(tag, opts = {}) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/hightouch.rb', line 40

def font_size_for_tag(tag, opts = {})
  max_font_size = opts[:max_font_size] || 36
  min_font_size = opts[:min_font_size] || 11

  max_count = max_tag.count
  min_count = min_tag.count

  size = begin
           if max_count == min_count
             min_font_size
           else
             min_font_size + (max_count - (max_count - (tag.count - min_count))) * (max_font_size - min_font_size).to_f/(max_count - min_count).to_f
           end
         end
end