Ghost will not read custom theme in content/themes
.
#437
Replies: 2 comments
-
I have to admit that my experience with Themes in Ghost is extremely limited -- from https://ghost.org/help/installing-a-theme/#installing-a-theme-manually, it seems possible that Ghost does not auto-discover themes in that directory and that more is required for it to pick them up, but perhaps that's inaccurate and something else is happening here? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Ok, it took a lot of tries, and I got lost in some Ghost-specific details along the way, but the end result was success. I'm running https://github.com/tianon/rawdns locally (which is why I'm using $ # I start with `bash` instead of letting Ghost start since we need to restart Ghost after installing a theme and that was easier for me than doing this correctly with a volume, etc
$ docker run -it --rm --name ghost --pull=always --env database__client=sqlite3 --env database__connection__filename=content/data/ghost-non-production.db --env database__useNullAsDefault=true --env url=http://ghost.docker:2368 --env NODE_ENV=development --env mail__transport=stub ghost bash
root@96b1971bde38:/var/lib/ghost# # I started with "apt-get update" and "apt-get install git" so I can just "git clone" the theme later
root@96b1971bde38:/var/lib/ghost# apt-get update
root@96b1971bde38:/var/lib/ghost# apt-get install git
root@96b1971bde38:/var/lib/ghost# # switch to the "node" user -- I should've used "--user node" instead but this is easy enough
root@96b1971bde38:/var/lib/ghost# gosu node bash
node@96b1971bde38:/var/lib/ghost$ # initialize all the content directories
node@96b1971bde38:/var/lib/ghost$ docker-entrypoint.sh node current/index.js
...
Ctrl+C
node@96b1971bde38:/var/lib/ghost$ git clone https://github.com/TryGhost/Starter.git content/themes/starter
node@96b1971bde38:/var/lib/ghost$ cd content/themes/starter/
node@96b1971bde38:/var/lib/ghost/content/themes/starter$ npm install
...
added 435 packages, and audited 436 packages in 4s
...
node@96b1971bde38:/var/lib/ghost/content/themes/starter$ cd /var/lib/ghost/
node@96b1971bde38:/var/lib/ghost$ docker-entrypoint.sh node current/index.js
... Now I was able to go in my browser to http://ghost.docker:2368/ghost/#/settings/design/change-theme and after setting things up I was able to successfully swap to my "Starter" theme. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using this to run a Ghost instance, and inside
$(pwd)/vol/content/themes/starter
on my macOS host I have the starter theme:https://github.com/TryGhost/Starter
It is checked out from that git repo, npm installed, and
npm run build
has been run.I restart the container, and the theme files are in the folder and readable from the container.
But the Ghost UI (Settings -> Themes -> Installed) does not show it.
I have also tried changing all the permissions of the files to chmod 777 and also changed them to be owned by node.
Is this the correct way to enable a custom theme with the docker container?
Beta Was this translation helpful? Give feedback.
All reactions