Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
872 B

  1. const utils = require('../utils/utils.js');
  2. const Promise = require('promise');
  3. module.exports=
  4. {
  5. /** Method which renders the entire sidebar through calling
  6. * appropriate widget js files.
  7. *
  8. * @param res
  9. * @returns {*|Promise}
  10. */
  11. main: function()
  12. {
  13. return new Promise(function(resolve, reject)
  14. {
  15. Promise.all([utils.include("sidebar/sidebar.html"),
  16. require("../sidebar/recentPosts.js").main(),
  17. require("../sidebar/categoriesSideBar.js").main()]).then(function(content)
  18. {
  19. resolve("<div class=\"col-md-4\">" + content.join('') + "</div>");
  20. }).catch(function(error)
  21. {
  22. reject(error);
  23. });
  24. })
  25. }
  26. };