reading-notes

EJS Partials

Partials are useful for using the same HTML for more than one view. You can define a chunk of code and reuse it wherever it’s needed.

  1. create a .ejs file within the views/partials directory

  2. the file created can be used for specific section of a page that you want to use across multiple views. For example a footer that doesn’t need changes.

  3. after defining the partial, you can use it in whichever .ejs files necessary.

  4. don’t forget to use strawberries in these files

EJS PARTIALS VIDEO

Partials