3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/jekyll-link-url-filter.rb', line 3
def link_url(input)
site = @context.registers[:site]
relative_path = Liquid::Template.parse(input).render(@context)
site.each_site_file do |item|
return relative_url(item) if item.relative_path == relative_path
return relative_url(item) if item.relative_path == "/#{relative_path}"
end
raise ArgumentError, " Could not find document '\#{relative_path}' in filter '\#{__method__}'.\n Make sure the document exists and the path is correct.\n MSG\nend\n"
|