Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiles into JavaScript functions for use in client-side (sub. grunt-ec... #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbolila
Copy link

@jbolila jbolila commented Sep 23, 2013

some changes to allow creation of Javascript files of templates. Is very similiar with grunt-eco, and also with other asset packaging libraries like Jammit and Sprockets (in Ruby).

Backbone.js explained in CoffeeScript use this kind of JST objects to render Backbone Views, based on Eco templates.

thanks

if (!window.JST) {
window.JST = {};
}
window.JST['templates/eco.js'] = function (__obj) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One might expect a .js.eco fiile to be a JavaScript file that has some eco formatting. Perhaps something like this:

var user = "<%= name %>";
document.write("I'M SHOUTING AT YOU, <%= @name.toUpperCase() %>!");

It might make sense to provide an additional extension for this. Maybe something like a .jst.eco convention? What are your thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobLoach good point

@RobLoach
Copy link
Contributor

Another solution would be to use https://github.com/docpad/docpad-plugin-multiplelayouts , and have a layout that would output the JSON template data for it.

@balupton
Copy link
Member

balupton commented Aug 1, 2019

I have become too preoccupied by other things to review, merge, and release this PR.

However, you should have received an invite a while ago to join the DocPad Extras Team, which will give you write access to this repository, so you can merge in the PR.

For an orientation, or if you need any assistance following the semi-automatic release process from CONTRIBUTING.md, then reach out via https://bevry.me/discord/dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants