reading-notes

View project on GitHub

EJS Partials:

Partials come in handy when you want to reuse the same HTML across multiple views.Partials make large websites easier to maintain as you don’t have to go and change a piece of text in every page it appears in. Instead, you define that reusable bundle of code in a file andinclude it wherever you need it.

In EJS, any JavaScript or non-HTML syntax you include in your templates is always surrounded by <% %> delimiters

Including a partial in EJS is quite straightforward. You use <%- include( PARTIAL_FILE ) %> where the partial file is relative to the template you use it in.

Done by Omar-zoubi