Class: Nanoc::DataSources::Filesystem::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc-conref-fs/conref-fs.rb

Instance Method Summary collapse

Instance Method Details

#old_parse_metadataObject



6
# File 'lib/nanoc-conref-fs/conref-fs.rb', line 6

alias_method :old_parse_metadata, :parse_metadata

#parse_metadata(data, filename) ⇒ Object

There are a lot of problems when trying to parse liquid out of the frontmatter—all of them dealing with collision between the { character in Liquid and its signfigance in YAML. We’ll overload the parse method here to resolve those issues ahead of time.



11
12
13
14
15
# File 'lib/nanoc-conref-fs/conref-fs.rb', line 11

def (data, filename)
  wrapped_data = data.gsub(/^([^:]+): (\{\{.+)/, '\1: \'\2\'')

  (wrapped_data, filename)
end