An easier way to setup a development environment for Ghost Themes using VSCode Devcontainers and Docker
It will also automatically clone the Ghost-Advisory-Theme into the content/theme folder and build it as per "Speedy Development"
Scripts are provided to restart Ghost (ghostrestart) and restart the Tailwind JIT Theme Builder (themerefresh)
- Install Docker Desktop and run it for first time setup
- Install Visual Studio Code
- Install Extension Remote - Containers for VSCode
- Install Git
- Setup credentials for Git [Username and Email]
-
git clone https://github.com/AdvisorySG/GhostDevEnv.git $HOME/GhostDevEnv
-
code $HOME/GhostDevEnv
(Or just open folder$HOME/GhostDevEnv
in VSCode) -
Click on at the bottom left most corner of VSCode and Click Reopen in container
-
Wait for container to build
-
Open new terminal with Ctrl + Shift + `
-
Go to localhost:2368/ghost Admin Page or localhost:2368 Visitor Page
-
Follow Commands
Run command ghostrestart
to (re)Start Ghost
Run command themerefresh
to (re)Start Ghost Theme listener (same as npm run dev in Theme folder)
Simply open $HOME/GhostDevEnv
in VSCode and follow step (3) onwards in How to use?
Alternatively you can click >File>Save Workspace As
to save as a workspace config
Open new terminal with Ctrl + Shift + `
Follow Commands
Refresh Tailwind JIT Builder to update CSS in themes
Open new terminal with Ctrl + Shift + `
themerefresh
Restart Ghost to detect themes
Open new terminal with Ctrl + Shift + `
ghostrestart
Happy Coding ~Dylan