Notes on ghost theme management for a future Melanie
- To ground yourself in ghostly reality, check out these docs on installing ghost locally: https://ghost.org/docs/install/local/
Your repository
You have a ghost development repository in your projects directory called dev-ghost
.
- From this project's directory, start the application by running
ghost start
- View the admin interface at http://localhost:2368/ghost/
- Import posts from actual blog by following these instructions: https://ghost.org/faq/the-importer/ (don't forget to back up your images, this time I forgot)
Casper theme development
To modify the Casper theme, you'll need to cd
into the casper
directory, located at content/themes/casper
. You've set up a nice shortcut in your .bash_profile
too at casper
.
Casper uses Handlebars as its templating language. Refer to the wonderful docs to remind yourself how to use for theme development: https://ghost.org/docs/api/v3/handlebars-themes/
This time around, you've decided to migrate to collections
to organize your content. Read about collections
here: https://ghost.org/docs/api/v2/handlebars-themes/routing/collections/
When you make CSS changes, you will have to push the built assets to github. Don't forget to follow Casper's instructions for building your CSS! At the time of this writing, you would use yarn install
and yarn dev
to build your assets automatically. You can read the docs for the Casper theme here.
The github repository casper, when downloaded as a ZIP file, is uploaded directly on your ghost(pro) admin page. This means that there is no building or compiling happening for you outside of the local build. If you decide to get fancier and automate the update process, perhaps this will change.
Keep in mind: Handlebars provides many helper functionalities that work like magic. View the get
request or next_post
for info:
- https://ghost.org/docs/api/v3/handlebars-themes/helpers/get/
- https://ghost.org/docs/api/v3/handlebars-themes/helpers/prev_next_post/
Also, certain words are keywords within Ghost. In particular, having a collection named private
does not work; it conflicts with the naming of a password-protected domain, which will redirect to [url]/private to ask the visitor for a password.