"Partials" in Ghost are snippets of code housed in small HTML files that can be used within other template files. They always live in the /partials folder of a theme.

You can include them within a template like this:

  {{> "comments"}}

This would load the HTML from partials/comments.hbs into the page.

In some cases, you may want to pass data into a partial from the parent template file.

This is done simply by listing the data after the partial name, like this:

  {{> "comments" show_something=true}}

Now the variable show_something is true within the partials/comments.hbs partial file.

Thanks for reading!

Dan Rowden   Dan Rowden

I am the founder of Codelet. I have five years experience publishing and developing for Ghost, on over 100 sites. Codelet publishes Ghost themes, blog posts and offers expert Ghost support.