Class: Alula::LinkToTag

Inherits:
Tag
  • Object
show all
Defined in:
lib/alula/core_ext/tags/link_to.rb

Instance Attribute Summary

Attributes included from LiquidExt

#context

Instance Method Summary collapse

Methods included from LiquidExt

included, #initialize, #render

Instance Method Details

#contentObject



3
4
5
6
7
8
9
10
11
# File 'lib/alula/core_ext/tags/link_to.rb', line 3

def content
  target = if @options["href"]
    @options["href"]
  elsif @options["slug"]
    item = @context.site.content.by_slug(@options["slug"])
    item.nil? ? "" : item.url
  end
  @context.link_to(@options["source"], target)
end