https://github.com/devcybiko/my-hbs-demo
https://github.com/devcybiko/my-hbs-demo
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/devcybiko/my-hbs-demo
- Owner: devcybiko
- Created: 2020-03-11T19:51:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T15:21:55.000Z (over 3 years ago)
- Last Synced: 2026-03-25T16:30:03.906Z (3 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Handlebars for Non-HTML
## Install Handlebars CLI
`npm install hbs-cli --global`
## Test hbs-cli
`hbs --help`
## Run the script
`run.sh`
## See the results
* test-1.xml
* test-2.email
## NOTES
### test-1
* test-1.xml.template // handlebars
* test-1.json // data
* `run.sh` // runs the hbs cli and mvs the resultant file to .xml
```
hbs test-1.xml.template --data test-1.json ## => test-1.xml.html
mv test-1.xml.html test-1.xml ## move the file to .xml
```
### test-2
* test-2.email.template // handlebars
* product.json // data for the product offering
* me.json // data for the merchant's info
* `run.sh` // runs the hbs cli and mvs the resultant file to .xml
```
hbs --data product.json test-2.email.template --data '{"friend": "Anthony"}' --data me.json ## => test-2.email.html
mv test-2.email.html test-2.email ## move the file to .email
```