Create custom file templates for your project.
Setup where your Blueprint templates will be stored
- Create a folder anywhere in your project matching the templates path setting.
By default, the path is set to
blueprint-templates. (See Extension Settings if you would like to change this)
- Create a template group by adding a new folder under the blueprint templates storage folder
- Add a template to the group by creating a new file
Create from a template
- Right click on the file or folder in the explorer
- Select "New file from template"
- Enter a name
To change the default storage location for where Blueprint templates are stored,
⌘, under Visual Studio Code preferences and
// Where your Blueprint templates are stored. Templates are loaded relative to your workspace root path. Defaults to ./blueprint-templatesExamples:"blueprint.templatesPath":"./blueprint-templates","../path-one-level-up-from-workspace","~/path-from-home-folder","/path-from-root]
|Helper Name||Example Use In Templates||Example Use in File/Folder Names||Sample Result|
You can optionally include a "manifest.json" file in your template folders. This enables a few additionally points of customization.
|key||Description of Use|
|suffixesToIgnoreInInput||If the value is "component" for instance, if user enters "My First Component" as the input -- "My First" will be used in the substitutions. This is to enable you to put "Component" in the template and not have to worry about the user entering it or not.|
|createFilesInFolderWithPattern (DEPRECATED)||Create your template files within a folder -- uses the same transfrom as you would use during naming your files and folders. This is possible now by just creating a top-level folder in your template. Previously we did not support folders within folders. You should use that technique instead of using this key.|
Example templates can be found here: blueprint-examples
We will continue to add new templates that we think may be helpful to use!
- Skip content replacement on files that cannot read by handlebars. Useful for non-text files like images and video.
Bug Fix: Fixes detection of possible overwrites on file creation.
Cleanup of template selection user interface; the template name is now emphasized again.
Allow templates to include hidden folders and files. System created files (Thumbs.db, .DS_Store, etc. are still ignored).
Added two new transform helpers: lowerCase and upperCase.
Adds ability to provide multiple folders of templates. Useful for using both a project local and a shared (global) templates.
Template folder paths also now expand ~ to the home directory.
Added a new transform helper: lowerDotCase!
Now supports non-unix paths, AKA Windows support!
You can now create folders and nested folder/file structures inside a template folder. Folder names inside a template folder can be templated the same way that file names are.
Fixes missing dependency in initial release.