Method: MarkdownRecord::PathUtilities#erb_locals_from_path

Defined in:
lib/markdown_record/path_utilities.rb

#erb_locals_from_path(full_path) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/markdown_record/path_utilities.rb', line 46

def erb_locals_from_path(full_path)
  filename, subdirectory = *full_path_to_parts(full_path)
  
  frag_id = path_to_fragment_id(full_path)

  fragment = ::MarkdownRecord::ContentFragment.force_render_find(frag_id)
  
  {
    filename: filename, 
    subdirectory: subdirectory, 
    frag_id: frag_id,
    fragment: fragment,
    scope: fragment.__scope__
  }
end