0.5.0 • Published 7 years ago

ember-index v0.5.0

Weekly downloads
62
License
MIT
Repository
github
Last release
7 years ago

Ember-index

npm version Build Status Ember Observer Score

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.exports = function(environment) {
  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 -->
<!DOCTYPE html>
<html>
  <head>
     ...
     {{content-for 'ember-index-1'}}
     {{content-for 'ember-index-2'}}
  </head>
  <body>
      ...
  </body>
</html>

Will result

<!-- dist/index.html -->

<!DOCTYPE html>
<html>
  <head>
    <meta content="Example 1">
    ...
  </head>
  <body>
    ...
  </body>
</html>
<!-- dist/export/index.jsp -->
<!DOCTYPE html>
<html>
  <head>
    <meta content="Example 2">
    ...
  </head>
  <body>
    ...
  </body>
</html>

Tests

npm run test

License

MIT

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

8 years ago

0.2.9

8 years ago

0.2.8

9 years ago

0.2.7

9 years ago

0.2.6

9 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago