Module: JekyllDeployShosetsu::Util

Defined in:
lib/jekyll-deploy-shosetsu/util.rb

Class Method Summary collapse

Class Method Details

.append_yaml_front_matter(path, yaml) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/jekyll-deploy-shosetsu/util.rb', line 4

def append_yaml_front_matter(path, yaml)
  content     = File.read(path)
  config      = content[Jekyll::Document::YAML_FRONT_MATTER_REGEXP, 1]
  new_config  = config + yaml
  new_content = content.gsub(config, new_config)
  File.write(path, new_content)
end