Creating Ghost Partials Files
Casper already has an example of a partials file, but if you are looking to create one, in the theme's root folder, create a
partials folder if it doesn't already exist.
Then, inside this folder, create a new .hbs file called whatever you want (we will use
example.hbs, I am just going to create a super basic loop through each post:
Now, in my
index.hbs and my
tag.hbs, instead of having this same code loop through all of the posts, I am going to tell it to use the partial file. Add this line using the name of your partial file inside the quotes wherever you want that partials code to run:
And thats it! Now the code from the partial file will be inserted where you add that helper.