sourcejs / Source

[ON HOLD] Living Style Guides Engine and Maintenance Environment for Front-end Components. Core repository.
http://sourcejs.com
MIT License
552 stars 47 forks source link

Customize templates using EJS exclusively. #233

Open ndelangen opened 8 years ago

ndelangen commented 8 years ago

In Core we should try to unify where templates are and how they can be overridden.

Currently this is how a user must override the 'Navigation markup' (at least according to the docs):

module.exports = {
  core: { ... },
  assets: {
    ...
    moduleOptions: {
      globalNav: {
        templates: {
          catalogHeader: _.template('<h2 class="custom-class">&lt;%= catalogMeta.title %&gt;</h2>'),
        }
      }
    }
  }
}

It should be a possible to just drop a .ejs file in some folder.

This brings me to the second example where we should unify our interface:

/core/views/ contain .ejs files /assets/templates/ contain .html files (with ejs bindings)

I suggest we move all html-like files to a folder named /core/templates/.

We can group certain templates together, for example all page-templates can go into /core/templates/page/. etc.

robhrt7 commented 8 years ago

Moving page navigation generation to server side, the /core/views/ will be the natural choice for the templates, where it could be overridden with an existing approach.

ndelangen commented 8 years ago

0.7 milestone?

robhrt7 commented 8 years ago

Yeah, closer to that.