Skip to content

interviewplanner/ghost-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghost-theme

Ghost theme for the InterviewPlanner blog.

Development

Requirements

  • Node v16.15.1
  • yarn

First-time setup

The first time you clone this repo, you will need to set up a few things with the following command.

$ yarn
$ yarn setup

This performs a local installation of Ghost. It also links your package.json into your theme directory, and links your theme directory into your ghost/content/themes directory, so that you can preview your theme locally.

If this isn't your first time, but you're coming back to this repo after a while, you should reset your repo and rerun everything. To reset it, you can run the following command.

$ git clean -xdff

Developing

  1. Start Ghost.
$ yarn start
  1. Navigate to http://localhost:2368/ghost/ and set up your blog (e.g. create an account, name your blog, etc).

  2. In http://localhost:2368/ghost/#/settings/design, scroll to the bottom and activate the interviewplanner theme.

  3. As you make changes to the theme, you can see them on your local Ghost blog. If you aren't seeing your changes, it may be because of Ghost caching your styles. You can do a hard refresh (Shift+Cmd+R on Chrome on Mac) to see them.

Linting

To make sure you're making a theme that's compatible with Ghost, you can run the following command to run gscan to validate our theme.

$ yarn lint

There are some known warnings that we just ignore:

  • Warning: Assets such as CSS & JS must use the {{asset}} helper: The links that it's referring to in header.hbs and footer.hbs are absolute URLs to our logo. We can't use the {{asset}} helper for absolute URLs. I wish the linter was smarter.

Deploying

  1. Merge PR to master.

  2. Get master up-to-date on your local machine.

$ git checkout master
$ git rebase master
  1. Create a new version.
$ yarn release:patch # or release:minor or release:major
  1. Create a bundle.
$ yarn bundle
  1. Go to the staging blog settings and upload the bundle.

  2. If everything looks good in staging, go to the production blog settings and upload the bundle.