Why does ghost-cli installation has two folders with the same name `current`?

#1

I’ve just ran ghost install local and got the following directory structure with very similar content folders:

content      <==========================
     apps
     data
     images
      ...
current
versions
   2.22.0
       content    <=====================
            data
            images
            ...
       core
       ...

My question is why do we need both? I tried renaming each one but it seems they are all required to run ghost. After I’ve renamed the top level content ghost couldn’t start. After I’ve renamed the folder inside the current ghost version I got 500 saying that the currently active theme "casper" is missing.

Can anyone please clarify?

#2

The top level content folder is where your images and other user-generated content (including the db if you use sqlite) is stored. The version-level content folder is mainly used for developing Ghost, but also contains the latest release of casper. That way, if you’re using the default theme, you’ll always be up-to-date :slight_smile:

1 Like
#3

Cool, thanks! So as I understand the top level content folder is where all my theme customizations should go, correct? I’ve now checked the the content\themes\casper and it’s a symlink pointing to casper inside the Ghost installation in versions.

I’ve also explored sources a little bit, the current theme seems to be defined in core/server/data/schema/default-settings.json. I assume you somehow deploy the new scheme using Ghost-CLI and it updates this value. Am I on the right path here? :slight_smile:

#4

That’s correct! While you can make direct changes to the symlinked casper theme, it’s usually suggested to clone it to another folder. If your active theme is invalid, ghost will fall back to the casper theme

Nope - If you want to add or activate a theme, you do that in the admin interface! Once you get Ghost up and running, you usually shouldn’t need to make any file system changes, unless you’re upgrading ghost :slight_smile:

#5

If you want to add or activate a theme, you do that in the admin interface! Once you get Ghost up and running, you usually shouldn’t need to make any file system changes, unless you’re upgrading ghost

Yep, thanks. Just found it that setting a new theme through admin interface updates the value in the settings database for the key active_theme. It does it inside core/server/api/v2/themes.js when the request to activate a new theme comes through.