Clone this repo first, and set it up:
git clone git@github.com:rubycentral/rubycentral-theme.git
cd rubycentral-theme
npm install
Then, set up a local Ghost install for development, and symlink in the theme:
cd ..
mkdir ghost-dev
cd ghost-dev
npm install -g ghost-cli
ghost install local
Next, symlink from the theme checkout to your local Ghost themes folder:
# in /ghost-dev
ln -s [absolute path on your machine]/rubycentral-theme ./content/themes/rubycentral-theme
ghost restart
Now, you need to activate the symlinked theme.
- From a fresh install, you'll need to create a fake account, like
me@example.com
and password123abc123abc
. Go to http://localhost:2368/ghost/#/setup. - Open your local Ghost theme settings, by default localhost:2368/ghost/#/settings/design/change-theme.
- Click the "Advanced" button in the top right.
- Push "Activate" for
rubycentral-theme
. If you don't see it, it's not symlinked properly. - Browse to localhost:2368 and you should now see the theme, but with no content. The example posts may not be styled properly, this is ok.
Finally, to seed your local Ghost install with directors, staff, and posts, you will need to import everything in imports/
.
- Open your local Ghost experimental settings at localhost:2368/ghost/#/settings/labs
- Go to [https://rubycentral.ghost.io/ghost/#/settings/labs] and click "Export your content". You should get a
.json
file locally. - On the same page, click "download redirects" and "download routes" also. We will upload these too.
- Click "Open Importer", and then upload the
.json
file. - Click "Upload redirects YAML/JSON" and choose
redirects.yaml
. - Click "Upload routes YAML" and choose
routes.yaml
. - In
/rubycentral-theme
, start the live reload server and compile your JS/CSS assets, and watch for changes:npm run dev
. If you do not do this, your text will look unstyled. - Wait a few moments and run
ghost restart
. You should now see images and content, including posts.
As you make changes, ideally your browser will automatically reload.
You might have to refresh by hand after each change.
If you can't see your changes, and you're sure that npm run dev
is still going, you'll likely need to disable your browser's caching.
Go to the Network tab in your dev tools and toggle "Disable cache".
The theme will automatically check, zip, and upload to Ghost via GitHub Actions. If you want to try it yourself locally:
# Fix any CSS issues, compile your JS/CSS assets for production, and create a ZIP file
npm run zip
# Scan your theme for potential incompatibilties with gscan
npm run check