I'm looking to add some more .hbs files to ghost/custom/themes/casper, such as an about page and landing page. This way, all files are using the same default layout and I have a /blog destination for my blog.
However, when I create an .hbs file, such as about.hbs, and give it the same code as in page.hbs, and upload it to the theme folder, when I go to my-url.com/about, it gives a 404.
So, how can I create custom .hbs pages?
.hbs
-file named like this: page-about.hbs
. From Ghost Documentation on custom pages:
For example, if you have an 'About' page with the url
/about/
, adding a template calledpage-about.hbs
will cause that template to be used for the about page, instead ofpage.hbs
, orpost.hbs
.These templates exist in a hierarchy. Ghost looks for a template which matches the slug (
page-:slug.hbs
) first, then looks forpage.hbs
and finally uses post.hbs if neither is available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With