We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3e656c commit 842bec8Copy full SHA for 842bec8
lib/jekyll-compose/file_info.rb
@@ -10,21 +10,11 @@ def file_name
10
end
11
12
def content
13
- <<-CONTENT.gsub /^\s+/, ''
14
- ---
15
- layout: #{params.layout}
16
- title: #{yaml_clean_title}
17
18
- CONTENT
19
- end
20
-
21
- private
+ front_matter = YAML.dump({
+ 'layout' => params.layout,
+ 'title' => params.title,
+ })
22
23
- def yaml_clean_title
24
- if params.title.include? ':'
25
- '"' + params.title + '"'
26
- else
27
- params.title
28
+ front_matter + "---\n"
29
30
spec/file_info_spec.rb
@@ -25,7 +25,7 @@
let(:expected_result) {<<-CONTENT.gsub(/^\s+/, '')
---
layout: post
- title: "A test: arg parser"
+ title: 'A test: arg parser'
CONTENT
31
}
0 commit comments