- Learning Bootstrap 4(Second Edition)
- Matt Lambert
- 406字
- 2021-07-14 10:32:19
Setting up the blog project
As I mentioned earlier, we're going to be building a blog throughout this book as we learn to use Bootstrap 4. Let's start by creating a new directory and call it something like Bootstrap Blog
. Open up that folder and create the following sub-directories inside it:
- css
- fonts
- img
- js
- partial
css
The css
directory will hold the Bootstrap framework's CSS file and a custom theme file which we'll build later on. Go to the Bootstrap source file directory and locate the dist/css
folder. From there, copy bootstrap.min.css
to our new blog project's css
directory.
fonts
The fonts
directory will hold either a font icon library such as Glyphicon or Font Awesome. Previously, Bootstrap shipped with Glyphicon but they have dropped it in version 4. If you wish to use it, you'll need to download the icon font set and then drop the files into this directory. You could also include a web font that you may want to use on your project in this directory. If you are looking for web fonts, a good place to start is Google Web Fonts.
img
The img
directory will hold any images used in the blog.
js
The js
or JavaScript directory will hold the Bootstrap framework JavaScript files. If you add any other third-party libraries, they should also be included in this directory. Go back to the Bootstrap source files one last time and locate the dist/js
folder. From there, copy bootstrap.min.js
to the js
directory in the blog project.
partial
The partial
directory will hold any reusable snippets of code that we want to use in multiple locations throughout our templates or web pages, for example, the header and footer for our project. It's important to note you can have as many partial files as you like or use none at all.
Within this folder, create two new files and name them _header.ejs
and footer.ejs
. For now, you can leave them blank.
EJS files
EJS stands for Embeddable JavaScript. This is a type of template file that allows us to use things such as partials and variables in our templates. Harp also supports Jade if you prefer that language. However, I prefer to use EJS because it is very similar to HTML and therefore really easy to learn. If you've ever used WordPress, it is very similar to using template tags to insert bits of content or components into your design.
- Android Wearable Programming
- Vue.js 3.x快速入門
- 一步一步學Spring Boot 2:微服務項目實戰
- FreeSWITCH 1.8
- The Computer Vision Workshop
- Internet of Things with Intel Galileo
- 程序員修煉之道:通向務實的最高境界(第2版)
- Gradle for Android
- Learning PHP 7
- ExtJS Web應用程序開發指南第2版
- Xcode 6 Essentials
- Elasticsearch Essentials
- TypeScript 2.x By Example
- Clojure High Performance Programming(Second Edition)
- AI輔助編程Python實戰:基于GitHub Copilot和ChatGPT