class Jekyll::Tags::IncludeRelativeTag

Public Instance Methods

page_path(context) click to toggle source
# File lib/jekyll/tags/include.rb, line 256
def page_path(context)
  page, site = context.registers.values_at(:page, :site)
  return site.source unless page

  site.in_source_dir File.dirname(resource_path(page, site))
end
tag_includes_dirs(context) click to toggle source
# File lib/jekyll/tags/include.rb, line 252
def tag_includes_dirs(context)
  Array(page_path(context)).freeze
end

Private Instance Methods

resource_path(page, site) click to toggle source
# File lib/jekyll/tags/include.rb, line 265
def resource_path(page, site)
  path = page["path"]
  path = File.join(site.config["collections_dir"], path) if page["collection"]
  path.delete_suffix("/#excerpt")
end