rubocop: fix link tag code style
This commit is contained in:
parent
41a8b10780
commit
0d11511914
|
@ -57,7 +57,6 @@ AllCops:
|
||||||
- lib/jekyll/static_file.rb
|
- lib/jekyll/static_file.rb
|
||||||
- lib/jekyll/stevenson.rb
|
- lib/jekyll/stevenson.rb
|
||||||
- lib/jekyll/tags/include.rb
|
- lib/jekyll/tags/include.rb
|
||||||
- lib/jekyll/tags/link.rb
|
|
||||||
- lib/jekyll/tags/post_url.rb
|
- lib/jekyll/tags/post_url.rb
|
||||||
- lib/jekyll/theme.rb
|
- lib/jekyll/theme.rb
|
||||||
- lib/jekyll/url.rb
|
- lib/jekyll/url.rb
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Jekyll
|
module Jekyll
|
||||||
module Tags
|
module Tags
|
||||||
class Link < Liquid::Tag
|
class Link < Liquid::Tag
|
||||||
TagName = 'link'
|
TAG_NAME = "link".freeze
|
||||||
|
|
||||||
def initialize(tag_name, relative_path, tokens)
|
def initialize(tag_name, relative_path, tokens)
|
||||||
super
|
super
|
||||||
|
@ -16,11 +16,15 @@ module Jekyll
|
||||||
return document.url if document.relative_path == @relative_path
|
return document.url if document.relative_path == @relative_path
|
||||||
end
|
end
|
||||||
|
|
||||||
raise ArgumentError, "Could not find document '#{@relative_path}' in tag '#{TagName}'.\n\n" \
|
raise ArgumentError, <<eos
|
||||||
"Make sure the document exists and the path is correct."
|
Could not find document '#{@relative_path}' in tag '#{TAG_NAME}'.
|
||||||
|
|
||||||
|
|
||||||
|
Make sure the document exists and the path is correct.
|
||||||
|
eos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Liquid::Template.register_tag(Jekyll::Tags::Link::TagName, Jekyll::Tags::Link)
|
Liquid::Template.register_tag(Jekyll::Tags::Link::TAG_NAME, Jekyll::Tags::Link)
|
||||||
|
|
Loading…
Reference in New Issue