HAML support for blank site template added (fixes #109)
Ivan Youroff
committed Sep 11, 2013
commit 2ae77dc140ecd53e5138cd2c47a60004dc37fbd1
Showing 3
changed files with
33 additions
and 1 deletions
generators/blank/app/views/pages/404.liquid.haml
+11
-0
| @@ | @@ -0,0 +1,11 @@ |
| + | --- |
| + | title: Page not found |
| + | published: false |
| + | --- |
| + | {% extends index %} |
| + | |
| + | {% block 'main' %} |
| + | |
| + | %p Page not found |
| + | |
| + | {% endblock %} |
| \ No newline at end of file | |
generators/blank/app/views/pages/index.liquid.haml
+12
-0
| @@ | @@ -0,0 +1,12 @@ |
| + | !!! |
| + | %html{lang: "en"} |
| + | %head |
| + | %meta{charset: "utf-8"} |
| + | %title {{ site.name }} |
| + | %meta{name: "keywords", value: ""} |
| + | %meta{name: "description", value: ""} |
| + | %body |
| + | %h1 {{ page.title }} |
| + | {% block 'main' %} |
| + | %p Lorem ipsum.... |
| + | {% endblock %} |
| \ No newline at end of file | |
locomotive/wagon/generators/site/blank.rb b/lib/locomotive/wagon/generators/site/blank.rb
+10
-1
| @@ | @@ -11,7 +11,16 @@ module Locomotive |
| version: Locomotive::Wagon::VERSION | |
| }) | |
| end | |
| - | |
| + | |
| + | def choose_haml_over_html |
| + | if yes?('Do you prefer HAML templates ?') |
| + | remove_file File.join(self.destination, 'app/views/pages/index.liquid') |
| + | remove_file File.join(self.destination, 'app/views/pages/404.liquid') |
| + | else |
| + | remove_file File.join(self.destination, 'app/views/pages/index.liquid.haml') |
| + | remove_file File.join(self.destination, 'app/views/pages/404.liquid.haml') |
| + | end |
| + | end |
| end | |
| Locomotive::Wagon::Generators::Site.register(:blank, Blank, %{ | |