Class: Jekyll::Tags::IncludeRelativeTag

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

Constant Summary

Constants inherited from IncludeTag

Jekyll::Tags::IncludeTag::FULL_VALID_SYNTAX, Jekyll::Tags::IncludeTag::INVALID_SEQUENCES, Jekyll::Tags::IncludeTag::VALID_FILENAME_CHARS, 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



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/ngage/jekyll/tags/include.rb', line 206

def page_path(context)
  if context.registers[:page].nil?
    context.registers[:site].source
  else
    site = context.registers[:site]
    page_payload  = context.registers[:page]
    resource_path = \
      if page_payload["collection"].nil?
        page_payload["path"]
      else
        File.join(site.config["collections_dir"], page_payload["path"])
      end
    site.in_source_dir File.dirname(resource_path)
  end
end

#tag_includes_dirs(context) ⇒ Object



202
203
204
# File 'lib/ngage/jekyll/tags/include.rb', line 202

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