Setting up the JSON files
Each Harp project has at least two JSON files that are used for configuring a project. JSON stands for JavaScript Object Notation and it's a lightweight format for data interchange. If that sounds complicated, don't worry about it. The actual coding of a JSON file is actually really straightforward, as I will show you now.
The first is called _harp.json
and it's used for configuring global settings and variables that will be used across the entire blog. In this case, we're going to set up a global variable for the name of our project that will be inserted into every page template. Start by creating a new file in the root of blog project and call it _harp.json
. Within the file, insert the following code:
{ "globals": { "siteTitle": "Learning Bootstrap 4" } }
Here's what's happening in this code:
- We're using the
globals
keyword so any variables under this will be available across all of...