// Templating:
// ===========
// Templating is used to reuse HTML code to display
// similar web pages. For Templating, we can use any
// of the various Templating engines like EJS, HandleBars(hbs), etc.
// here, we have installed hbs npm package,
npm i hbs
// Now, mostly all things will be same as in was for ejs but
// some changes will be there like:
// 1> while refrencing the passed objects in home.hbs and other
// UI/views files, we will use them like this {{ PassedObjectName }}
// rather than refrencing them like ⟩%= PassedObjectName %>
// 2> we will use the loops as we used them in home.hbs file:
⟨ul>
{{#each HomeArray}}
⟨li> {{this}} ⟨/li>
{{/each}}
⟨/ul>
// now, create folder "views" inside your project directory.
// and inside views, create home.ejs and subreddit.hbs file.
home.hbs
subreddit.hbs
// See in below index.js file on
// how we can use and work with HandleBars Templates,
index.js