unic / estatico

[DEPRECATED] Estático – Static site generator for frontend unicorns
Other
121 stars 18 forks source link

[Feature] Moving code and documentation data to build #61

Closed marbor3 closed 2 years ago

marbor3 commented 7 years ago

Moving data needed only for module preview into build process. This should lessen performance impact on requiring .data.js files within each other.

backflip commented 7 years ago

@marbor3 Looks like we can just return a function for both these helpers:

getDocumentation: function(filePath) {
    var stack = callsite(),
        requester = stack[1].getFileName(),
        requirePath = path.resolve(path.dirname(requester), filePath);

    return function() {
        var content = getFile(requirePath);

        marked(content);
    };
}

Handlebars seems to be able to deal with this without any changes to the template (i.e. it will evaluate meta.code when rendering).

I'd very much prefer this approach over moving logic back to the html task where no one really knows about it. What do you think?

orioltf commented 7 years ago

Hi @marbor3, there are conflicts that prevent merging. Would you mind resolving and having a look at Thomas comment? Thanks! :)

marbor3 commented 2 years ago

Hmm, quite old stuff :) closing