Ember-index
Ember addon for manipulating index.html
Why use it?
Ember cli is doing a great job at generating static assets including index.html
.
But sometimes you wish to generate an enhanced index file which is actually a server-page (JSP, PHP etc.).
In order to do so, you will need to include specific code blocks in the generated server-page, which won't be included in the generated index.html (and vice versa).
This simple addon is meant for doing exactly this.
Project's Wiki
Installation
npm i ember-index --save-dev
Usage
The following code:
// config/enironment.js module { var ENV = //... 'ember-index': output: 'index.jsp' destDir: 'export' // Optional (default: '.') content: key: '1' file: 'example1.txt' includeInIndexHtml: true includeInOutput: false key: '2' string: 'My Text' includeInIndexHtml: false includeInOutput: true ; //... return ENV;};
// app/example1.txt
<meta content="Example 1">
// app/example2.txt
<meta content="Example 2">
<!-- app/index.html --> ... {{content-for 'ember-index-1'}} {{content-for 'ember-index-2'}} ...
Will result
<!-- dist/index.html --> ... ...
<!-- dist/export/index.jsp --> ... ...
Tests
npm run test
License
MIT