Rebuilding my blog in JavaScript: the source
As I wrote previously, after rebuilding my blog in JavaScript I wanted to release the source without my content. I copied over most of the templates and modules for my blog into a public repo here: https://github.com/lkhrs/11ty-js
Gaze at it and don’t judge the inconsistent use of module.exports
: I’ve got files that use the module.exports = function()
convention, ones that use exports.data
and exports.render
, and at least one that uses a class passed to module.exports
.
All of these effectively do the same thing here; I think it’s a matter of code style and I haven’t settled on mine yet. I think the class convention looks the cleanest for multiple functions, but I also like how exports.data
and exports.render
looks. module.exports = function()
looks the best for single functions.