Instructions
Manual Installation
- Download the theme
- Log in to Ghost and navigate to the
Design
settings area to upload the theme's zip file. - After uploading, you can select the
MyGhost
theme for use.
Automatic Installation (recommended if you want to develop the theme further)
You can automatically install the theme via Github Action.
- Log in to your Ghost blog admin area, navigate to
Settings
>Integrations
>Add custom integration
to create an API. - Enter a name for the API, such as
Github Action
, and selectCreate
. - In the popup window, you will see the
Admin API Key
andAPI URL
. You will need these two values for the following steps. - Fork this repository: Fork MyGhost
- Log in to Github and navigate to the repository
Settings
area. - Under the
Secrets and variables
tab, selectActions
. - Next, choose
Secrets
, then clickNew repository secret
and create two environment variables:GHOST_ADMIN_API_URL
andGHOST_ADMIN_API_KEY
, with values corresponding to theAPI URL
andAdmin API Key
created in step 3. - Select
Actions
and clickI understand my workflows, go ahead and enable them
. - Select
Actions
and chooseDeploy Theme
. - Click
Run workflow
and wait for the installation process to complete.
Note: The above steps only need to be done once. Later, whenever you edit the theme code, commit and push the changes to Github, Github Action will automatically install the updated theme on your Ghost blog website.
Development
MyGhost is developed based on Ghost's basic Starter theme. You can refer to the Ghost Themes Documentation for more details.
Important: The theme is written using Handlebars and compiled with Gulp/PostCSS. You need to install Node, Yarn, and Gulp to develop the theme.
After installing the necessary software, you can run the following commands to develop the theme:
# Clone the repo
git clone https://github.com/nguyenhongthe/MyGhost.git
# Move into the theme directory
cd MyGhost
# Install dependencies
yarn
# Run the theme in development mode
yarn dev
You can now edit the files in /assets/css/
, which will be automatically compiled into the /assets/built/
directory.
To run the theme on a Ghost server, you need to create a symbolic link (symlink) from the theme directory to the Ghost blog content directory.
# Create a symbolic link
ln -s /dir/to/your/themes/MyGhost /dir/to/your/ghost-site/content/themes/myghost
Restart your Ghost blog, and the theme will appear in the Design
area of the Ghost Admin.
Useful Commands
Package the theme files into the dist/MyGhost.zip
file. You can upload this file to your website for manual theme installation.
yarn zip
Contributing and Reporting Issues
-
If you encounter any issues while using the theme or have suggestions for improvement, please create a new issue at nguyenhongthe/MyGhost/issues.
-
This repository is automatically synced with the private monorepo: nguyenhongthe/repo.vnscdn.com via Github Action. Please do not create pull requests directly in this repository.
Copyright and License
Copyright © 2012-2024 Nguyễn Hồng Thế Blog - Released under the MIT License.