diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index 43c7e31d..e3e3945d 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -1,3 +1,25 @@ +def file_content_from_hash(input_hash) + matter_hash = {} + %w(title layout tag tags category categories published author path date permalink).each do |key| + matter_hash[key] = input_hash[key] if input_hash[key] + end + matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp + + content = if input_hash['input'] && input_hash['filter'] + "{{ #{input_hash['input']} | #{input_hash['filter']} }}" + else + input_hash['content'] + end + + <