Refactor some of i18n for better codeclimate scores. In the process, make nested i18n files work like rails
This commit is contained in:
parent
86cd626084
commit
31f238f881
9 changed files with 109 additions and 69 deletions
|
@ -37,24 +37,11 @@ module Middleman
|
|||
cattr_accessor :middleman_app
|
||||
|
||||
def image(link, title, alt_text)
|
||||
if middleman_app && middleman_app.respond_to?(:image_tag)
|
||||
middleman_app.image_tag(link, :title => title, :alt => alt_text)
|
||||
else
|
||||
img = "<img src=\"#{link}\""
|
||||
img << " title=\"#{title}\"" if title
|
||||
img << " alt=\"#{alt_text}\"" if alt_text
|
||||
img << ">"
|
||||
end
|
||||
middleman_app.image_tag(link, :title => title, :alt => alt_text)
|
||||
end
|
||||
|
||||
def link(link, title, content)
|
||||
if middleman_app && middleman_app.respond_to?(:link_to)
|
||||
middleman_app.link_to(content, link, :title => title)
|
||||
else
|
||||
a = "<a href=\"#{link}\""
|
||||
a << " title=\"#{title}\"" if title
|
||||
a << ">#{content}</a>"
|
||||
end
|
||||
middleman_app.link_to(content, link, :title => title)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Middleman
|
||||
# Current Version
|
||||
# @return [String]
|
||||
VERSION = '3.1.0.rc.1' unless const_defined?(:VERSION)
|
||||
VERSION = '3.1.0.rc.2' unless const_defined?(:VERSION)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue