Class: Jekyll::Tags::IncludeRelativeTag

Inherits:
IncludeTag
  • Object
show all
Defined in:
lib/jekyll/tags/include.rb

Constant Summary

Constants inherited from IncludeTag

Jekyll::Tags::IncludeTag::VALID_SYNTAX, Jekyll::Tags::IncludeTag::VARIABLE_SYNTAX

Instance Method Summary collapse

Methods inherited from IncludeTag

#add_include_to_dependency, #file_read_opts, #initialize, #load_cached_partial, #locate_include_file, #outside_site_source?, #parse_params, #read_file, #realpath_prefixed_with?, #render, #render_variable, #syntax_example, #valid_include_file?, #validate_file_name, #validate_params

Constructor Details

This class inherits a constructor from Jekyll::Tags::IncludeTag

Instance Method Details

#page_path(context) ⇒ Object



212
213
214
215
216
217
218
219
# File 'lib/jekyll/tags/include.rb', line 212

def page_path(context)
  if context.registers[:page].nil?
    context.registers[:site].source
  else
    current_doc_dir = File.dirname(context.registers[:page]["path"])
    context.registers[:site].in_source_dir current_doc_dir
  end
end

#tag_includes_dirs(context) ⇒ Object



208
209
210
# File 'lib/jekyll/tags/include.rb', line 208

def tag_includes_dirs(context)
  Array(page_path(context)).freeze
end