Skip to content

amberframework/recipes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code generation recipes for the Amber Web Framework

Amber generators can use a recipe to generate your application, and scaffold your application with controllers, models and views. Using a recipe you can get started with an amber application that extends or modifies the standard built in generator or provides additional features. For example you might want an API application that only renders JSON or use React or AngularJS for views.

To create an amberframework application from a recipe type;

amber new <appname> -r <recipe>

to create a new amber app from the given named recipe in a folder with the given appname.

The given recipe can be either

  • a recipe from this repository
  • a directory with an application template
  • a URL pointing to a recipe folder (which should contain an app template)

Read the Recipes section in the online guides for more information.

Available recipes

Recipes in this repository are divided into themes based on the kind of application and scaffolding generated by the recipe. For example the basic_granite recipe mimics the Amber built-in application template using the Granite ORM.

To create a new amber app from this recipe at the command line type

amber new newapp -r basic_granite

to create a new amber app from the recipe at basic_granite in the folder newapp.

amber new newapp -r default

Uses a copy of the standard built-in template and is the same as typing

amber new newapp

Using a template in a local folder

You can use a local folder as the source template for a new amber application e.g.

mkdir default_recipe
wget https://raw.githubusercontent.com/amberframework/recipes/master/dist/default.zip
unzip -d default_recipe default.zip
amber new newapp -r default_recipe

The result of which is equivalent to

amber new newapp -r default

Available Recipes

Read Contributions to see a list of available themes and app recipes. Each theme folder provides additional information in the folder README.

Recipe issues

If you notice a problem with a recipe please raise an issue including example of the expected output and actual output or any errors using the application generated by the recipe.

Notes to Contributors

Recipes use the Liquid template language. The file extension should be .liquid but if you prefer shorter 3 letter file extensions you can also use .lqd which is an unknown or unnassigned file extension.

To create a new recipe

  1. Fork https://github.com/amberframework/recipes
  2. Clone your fork using git clone
  3. Create a new sub folder in the appropriate theme folder (or create a new theme if it doesn't already exist).
  4. Copy an existing recipe and make your modifications.
  5. Submit a PR.

Recipes should contain the following templates:

  • app
  • controller
  • model
  • scaffold

Don't forget to add an entry to Contributions.md and the theme folder README.md about your recipe.

Many Thanks.