Templating & HTML Partials

To avoid repetitive HTML code, FuzzyMail uses gulp-file-include. It has a simple templating synthax and allows to re-use chunks of code written in separate files. These partials are located in the directory:

src/includes/

Examples

Below you can find some examples how you can use imports.

<!DOCTYPE html>
<html>
  <body>
  @@include('./includes/view.html')
  @@include('./includes/var.html', {
    "name": "haoxin",
    "age": 12345,
    "socials": {
      "fb": "facebook.com/johndoe",
      "tw": "twitter.com/johndoe"
    }
  })
  </body>
</html>
src/index.html
<h1>view</h1>
src/includes/view.html
<label>@@name</label>
<label>@@age</label>
<strong>@@socials.fb</strong>
<strong>@@socials.tw</strong>
src/includes/var.html
<!DOCTYPE html>
<html>
  <body>
    <h1>view</h1>
    <label>haoxin</label>
    <label>12345</label>
    <strong>facebook.com/johndoe</strong>
    <strong>twitter.com/johndoe</strong>
  </body>
</html>
Output result
All Specifications
Set Up ProjectNew Pages

Follow the creator

Join the community