Reader small image

You're reading from  Bootstrap 4 Cookbook

Product typeBook
Published inJun 2017
Reading LevelBeginner
PublisherPackt
ISBN-139781785889295
Edition1st Edition
Languages
Right arrow
Author (1)
Ajdin Imsirovic
Ajdin Imsirovic
author image
Ajdin Imsirovic

Ajdin Imsirovic is a full-stack web developer who has published several courses on the subject of web design and web development. He has also authored three books, Bootstrap 4 Cookbook, Elm Web Development, and Vue.js Quick Start Guide. In his fourth book, Vue CLI 3 Quick Start Guide, he introduces readers to the rich ecosystem of frontend tooling and best practices.
Read more about Ajdin Imsirovic

Right arrow

Splitting up our Harp project into partials


In this recipe, we will split our existing project into partials, to keep our code DRY. Harp uses Embedded JS (EJS) format for includes. For more information on .ejs, visit http://www.embeddedjs.com/.

To begin, we can either continue from the previous recipe or clone the available repository for the recipe from the link https://github.com/ImsirovicAjdin/bootstrap4-with-sass-harp-grunt.

It is assumed in this recipe that you are using Cloud9 IDE. However, if that is not the case, then do not include the reference to workspace in commands to be run, as that folder is Cloud9-specific.

How to do it...

  1. In workspace/app, add a new folder and call it partial:
      cd && cd worspace/app && mkdir partial
  1. Add _nav.ejs to the partial folder--touch partial/_nav.ejs.
  2. Open the app/index.html and cut all the code starting with <nav> and ending with </nav> (the whole navbar). Paste the code into the _nav.ejs file.
  3. In index.html, right where...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Bootstrap 4 Cookbook
Published in: Jun 2017Publisher: PacktISBN-13: 9781785889295

Author (1)

author image
Ajdin Imsirovic

Ajdin Imsirovic is a full-stack web developer who has published several courses on the subject of web design and web development. He has also authored three books, Bootstrap 4 Cookbook, Elm Web Development, and Vue.js Quick Start Guide. In his fourth book, Vue CLI 3 Quick Start Guide, he introduces readers to the rich ecosystem of frontend tooling and best practices.
Read more about Ajdin Imsirovic