fix a typo in the metafields_schema syntax (generators) + better error message if a page doesn't exist

did committed Mar 21, 2016
commit 1d0e5f74539093a72599ce82110e541fa83ee853
Showing 5 changed files with 13 additions and 9 deletions
generators/blank/config/metafields_schema.yml +2 -2
@@ @@ -2,7 +2,7 @@
#
# Syntax:
#
- # - <namespace_1>: # no empty spaces, only digits and underscores
+ # <namespace_1>: # no empty spaces, only digits and underscores
# label: <my label> # used as the label of a tab in the back-office
# # label: # if you want to provide the label in another language (back-office)
# # en: <your label in English if the local of the current user is English>
@@ @@ -22,7 +22,7 @@
# # <name_2>:
# # ...
#
- # - <namespace_2>:
+ # <namespace_2>:
# # ...
#
#
generators/bootstrap/config/metafields_schema.yml +2 -2
@@ @@ -2,7 +2,7 @@
#
# Syntax:
#
- # - <namespace_1>: # no empty spaces, only digits and underscores
+ # <namespace_1>: # no empty spaces, only digits and underscores
# label: <my label> # used as the label of a tab in the back-office
# # label: # if you want to provide the label in another language (back-office)
# # en: <your label in English if the local of the current user is English>
@@ @@ -22,7 +22,7 @@
# # <name_2>:
# # ...
#
- # - <namespace_2>:
+ # <namespace_2>:
# # ...
#
#
generators/foundation5/config/metafields_schema.yml +2 -2
@@ @@ -2,7 +2,7 @@
#
# Syntax:
#
- # - <namespace_1>: # no empty spaces, only digits and underscores
+ # <namespace_1>: # no empty spaces, only digits and underscores
# label: <my label> # used as the label of a tab in the back-office
# # label: # if you want to provide the label in another language (back-office)
# # en: <your label in English if the local of the current user is English>
@@ @@ -22,7 +22,7 @@
# # <name_2>:
# # ...
#
- # - <namespace_2>:
+ # <namespace_2>:
# # ...
#
#
generators/site_metafields/schema.yml.tt +2 -2
@@ @@ -2,7 +2,7 @@
#
# Syntax:
#
- # - <namespace_1>: # no empty spaces, only digits and underscores
+ # <namespace_1>: # no empty spaces, only digits and underscores
# label: <my label> # used as the label of a tab in the back-office
# # label: # if you want to provide the label in another language (back-office)
# # en: <your label in English if the local of the current user is English>
@@ @@ -22,7 +22,7 @@
# # <name_2>:
# # ...
#
- # - <namespace_2>:
+ # <namespace_2>:
# # ...
#
#
locomotive/wagon/commands/serve_command.rb b/lib/locomotive/wagon/commands/serve_command.rb +5 -1
@@ @@ -151,7 +151,11 @@ module Locomotive::Wagon
filepath = File.join(File.expand_path(path), 'app', 'views', 'pages', fullpath + (locale != default_locale ? ".#{locale}" : '') + '.liquid')
- message = "[Tip]".light_white + " add a new page in your Wagon site at this location: " + filepath.light_white
+ message = if File.exists?(filepath)
+ "[Warning]".red + ' by default and unless you overide the slug in the YAML header of your page, Wagon will replace underscores by dashes in your page slug. Try this instead: ' + fullpath.dasherize.light_white
+ else
+ "[Tip]".light_white + " add a new page in your Wagon site at this location: " + filepath.light_white
+ end
Locomotive::Common::Logger.info (' ' * 2) + message
end