From 765a23468e4f59df9a0c6afcd283cbfe4530ea43 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 15 Jun 2016 15:59:31 -0700 Subject: [PATCH] Give the user a layout scaffolding. --- lib/jekyll/theme_builder.rb | 7 +++++++ lib/theme_template/example/_post.md | 3 +-- lib/theme_template/example/index.html | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/theme_builder.rb b/lib/jekyll/theme_builder.rb index 1ff22e6a..71f92e1c 100644 --- a/lib/jekyll/theme_builder.rb +++ b/lib/jekyll/theme_builder.rb @@ -12,6 +12,7 @@ class Jekyll::ThemeBuilder def create! create_directories + create_starter_files create_gemspec create_accessories create_example_site @@ -58,6 +59,12 @@ class Jekyll::ThemeBuilder mkdir_p(%w(example example/_posts)) end + def create_starter_files + %w(page post default).each do |layout| + write_file("_layouts/#{layout}.html", template("_layouts/#{layout}.html")) + end + end + def create_gemspec write_file("Gemfile", template("Gemfile")) write_file("#{name}.gemspec", template("theme.gemspec")) diff --git a/lib/theme_template/example/_post.md b/lib/theme_template/example/_post.md index cf40b7f0..145b21de 100644 --- a/lib/theme_template/example/_post.md +++ b/lib/theme_template/example/_post.md @@ -1,6 +1,5 @@ --- -# Specify a layout from your theme! -# This will be the layout users specify for their posts. +layout: post --- Eos eu docendi tractatos sapientem, brute option menandri in vix, quando vivendo accommodare te ius. Nec melius fastidii constituam id, viderer theophrastus ad sit, hinc semper periculis cum id. Noluisse postulant assentior est in, no choro sadipscing repudiandae vix. Vis in euismod delenit dignissim. Ex quod nostrum sit, suas decore animal id ius, nobis solet detracto quo te. diff --git a/lib/theme_template/example/index.html b/lib/theme_template/example/index.html index d3187773..b688538c 100644 --- a/lib/theme_template/example/index.html +++ b/lib/theme_template/example/index.html @@ -1,5 +1,5 @@ --- -# Specify a layout from your theme! +layout: page --- Lorem ipsum dolor sit amet, quo id prima corrumpit pertinacia, id ius dolor dolores, an veri pertinax explicari mea. Agam solum et qui, his id ludus graeco adipiscing. Duis theophrastus nam in, at his vidisse atomorum. Tantas gloriatur scripserit ne eos. Est wisi tempor habemus at, ei graeco dissentiet eos. Ne usu aliquip sanctus conceptam, te vis ignota animal, modus latine contentiones ius te.