Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Bootstrap Site Blueprints Volume II
Bootstrap Site Blueprints Volume II

Bootstrap Site Blueprints Volume II: Maximize the potential of Bootstrap for faster and more responsive web applications

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Bootstrap Site Blueprints Volume II

Chapter 2. Building a Restaurant Website

In the previous chapter, we laid down the foundation that will be used in all our blueprints moving forward. In the second chapter, we'll use our Harp.js development environment and build an actual restaurant website. This will include building more page templates, introducing Google Web Fonts, customizing Bootstrap components, and much more. But before we jump right into it by expanding on the files we set up in the first chapter, let's preview the home page for our new restaurant website:

Building a Restaurant Website

Building our development environment

In the first chapter, we kept our Harp.js development environment pretty basic. We did this because we want to be able to use it as a boilerplate for all our projects. The first thing that we need to do in this chapter is expand on our original work to customize and extend it for our restaurant website.

Adding more pages

Now, the first thing we should do is update _data.json with all the new pages that we'll be building for our restaurant website. Along with our home page, let's add three new pages: Menu, About, and Contact. Our file should look like this:

{
  "index": {
    "pageTitle": "Home"
  },
  "menu": {
    "pageTitle": "Menu"
  },
  "about": {
    "pageTitle": "About"
  },
  "contact": {
    "pageTitle": "Contact"
  }
}

As you can see, I've added three new sections to our JSON file. Make sure you name your files...

Home page

The home page for the restaurant website will be split into four main parts: a primary image banner, an "about the restaurant" statement, a few food thumbnails that will link to our menu page, and a Bootstrap reviews carousel. Here's what the page that we'll be creating will look like:

Home page

Adding the primary header image

We're going to set up some reusable styles for this image banner, which will be present across multiple pages of the website. Here's the code for the home page banner:

<div class="public-banner">
    <div class="row">
      <div class="col-lg-12">
        <img src="img/banner.jpg" width="1170" height="500" alt="Public Restaurant Banner">
      </div>
    </div>
  </div>

The primary image for the design will stretch the entire width of the layout. The problem is that Bootstrap provides some padding here by default. Using the .public...

The About page

The next page for our restaurant website is the About page. This page will feature a two-column layout and some custom text styles to give it a unique look. Here's a screenshot of what we'll be building:

The About page

Changing the feature image

The first thing that we need to do is create a new file called about.ejs. Next, we'll change the feature image as displayed in the preceding screenshot. To do this, we'll simply update this image line of code:

<img src="img/banner-about.jpg" width="1170" height="500" alt="Public Restaurant About Banner">

Make sure you update the alt text to optimize your image for search results. The next thing we need to do is set up our two-column layout. I'm going to wrap a <div> with a class of .page-body around the row, as we've done in the past:

<div class="page-body">

This will allow us to apply some padding around our main page body:

.page-body {
  padding: (@padding...

The Menu page

It's time to code the tastiest part of our restaurant website (sorry, that was a terrible pun). For our menu page, we'll use a three-column layout combined with some additional modal popups for our featured dishes. The following is a preview of what the page will look like:

The Menu page

As you can see, I've kept the layout pretty minimal, which is my style and will transfer well to the mobile view. Let's start by going over the page header style that is used for each section of the menu.

Customizing the .page-header class

For each section of the menu, I'm using a <h2> tag with the Bootstrap .page-header class to make it stand out. Here's what the code looks like:

<h2 class="page-header">Appetizers</h2>

Since we don't want our site to look like a generic Bootstrap project, I'm going to customize the look and feel of the page-header component:

.page-header {
  padding-bottom: (@padding * 1.5);
  margin: @margin 0;
  border-bottom...

The Contact page

We're down to the final page of our restaurant website. The last thing do is set up our Contact page, which will include an actual Google map along with some required content that all restaurants should ideally list on their website. Here's what the Contact page will look like once we're done:

The Contact page

Inserting the Google Map

If you haven't done this before, you should note that Google actually makes it quite easy to generate maps that you can insert into your website. First, let's head over to http://google.com/maps. Once it loads up, enter the address of your restaurant. I don't have an actual restaurant, so I'm just using Vancouver as my search term. After the map is generated, there will be a little Settings gear icon near the bottom-right corner of the window. Click on this icon and you'll see a pop-up menu. Choose the Share or Embed Map option from the menu.

Clicking on this link will launch a modal. Make sure you click on the second tab...

Building our development environment


In the first chapter, we kept our Harp.js development environment pretty basic. We did this because we want to be able to use it as a boilerplate for all our projects. The first thing that we need to do in this chapter is expand on our original work to customize and extend it for our restaurant website.

Adding more pages

Now, the first thing we should do is update _data.json with all the new pages that we'll be building for our restaurant website. Along with our home page, let's add three new pages: Menu, About, and Contact. Our file should look like this:

{
  "index": {
    "pageTitle": "Home"
  },
  "menu": {
    "pageTitle": "Menu"
  },
  "about": {
    "pageTitle": "About"
  },
  "contact": {
    "pageTitle": "Contact"
  }
}

As you can see, I've added three new sections to our JSON file. Make sure you name your files to match the first part. Then, I've defined a pageTitle value for each page. Save the file and close it.

Note

The _harp.json doesn't require...

Left arrow icon Right arrow icon

Key benefits

  • Build Bootstrap projects quickly and easily with Harp.js, Node, and Less
  • Learn how to extend Bootstrap with the use of open source JavaScript and icon web font libraries
  • Get acquainted with building complex social networking, wiki, and dashboard projects with Bootstrap

Description

Bootstrap is the most popular open source project on GitHub today. With a little bit of know-how, this massively popular CSS framework can leveraged for any type of complex web application or website. Bootstrap Site Blueprints Volume II will teach you to build these types of projects in an easy-to-understand fashion. The key to any complex Bootstrap project is a strong development foundation for your project. The book will first teach you how to build a Bootstrap development environment using Harp.js, Node, and Less. In the next chapters, we’ll build on this foundation by creating restaurant and mobile-first aggregator projects. Once you’re warmed up, we’ll move on to more complex projects such as a wiki, a new magazine, a dashboard, and finally a social networking website. Whether you are brand new to Bootstrap or a seasoned expert, this book will provide you with the skills you need to successfully create a number of popular web applications and websites.

Who is this book for?

Bootstrap Site Blueprints Volume II is geared for developers of all experience levels. It is written in a concise, easy-to-understand way. Each project follows a step-by-step process that anyone can understand. Some experience with Bootstrap beforehand would definitely be an asset but is not required.

What you will learn

  • Customize and extend existing Bootstrap JavaScript components
  • Combine the Google Material Design look and feel with Bootstrap
  • Use flexbox and other cutting-edge CSS3 techniques in Bootstrap
  • Implement and customize open source JavaScript chart libraries in Bootstrap
  • Optimize and implement an optimal user experience for all your projects
  • Implement the Disqus commenting platform into your projects

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 06, 2016
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781785281099
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jan 06, 2016
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781785281099
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 116.97
Bootstrap Site Blueprints
€37.99
Bootstrap 4 By Example
€36.99
Bootstrap Site Blueprints Volume II
€41.99
Total 116.97 Stars icon

Table of Contents

8 Chapters
1. Advanced Bootstrap Development Tools Chevron down icon Chevron up icon
2. Building a Restaurant Website Chevron down icon Chevron up icon
3. Mobile First Bootstrap Chevron down icon Chevron up icon
4. Bootstrap Wiki Chevron down icon Chevron up icon
5. Bootstrap News Magazine Chevron down icon Chevron up icon
6. Bootstrap Dashboard Chevron down icon Chevron up icon
7. Bootstrap Social Network Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Lisa Nov 04, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is great for developers who have some knowledge of HTML, CSS, Bootstrap and want to get to the next level. It is very easy to follow and references other great developer tools.
Amazon Verified review Amazon
Svein Soermo Apr 12, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
High quality projects and very good explanations.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.