Default card assets still showing with theme that excludes them in package.json

I am developing a custom theme for my new website. I created custom styles for all the editor cards, so I followed the documentation and excluded the default card assets in my package.json like so:

"config": {
  "card_assets": false
}

When I upload my theme to a staging version of the site, all of the default card assets are still included and override my custom styles. I ensured the format followed the docs and I also restarted the Ghost server after configuring this setting.

Am I using the correct formatting? Is there something else I must do for this to work?

It looks correct. Have you restarted Ghost? I haven’t been able to replicate it. If you’re still having issues, are you able to share your whole package.json file?

I just restarted the Ghost server again, and all is well. :man_shrugging: Maybe the first restart didn’t take, or I accidentally restarted my local server thinking it was the staging server. Thanks!.

2 Likes

Oh, I’ve never ever done that!

Er… ok, I think it’s been at least an hour since I’ve done that. :)

2 Likes

How about if you don’t have the ability to restart the server? For instance, when using Ghost on a managed Ghost(Pro) instance.

I have the same issue where card assets are included despite excluding them in the package.json for my custom theme.

I’ve verified that my package.json is correct and that the card assets are correctly excluded in my local server (where I have the ability to restart).

If you’re in ghost pro, you might want to contact them via their support address so they can have a look.

1 Like

Following up: this issue seems to have resolved on its own.

Perhaps the production Ghost(Pro) server simply restarted after some time and the card assets such as CSS are correctly excluded.

(If that didn’t work, I would have explored removing the {{ghost_head}} tag altogether to remove a bunch of unneeded stuff in favor writing my own. I still might.)

Been there, and done that. It was challenging.

I’ve got a PR that should give you some better options:

(Once it gets merged. Not live yet, and discussion ongoing about some details!)

1 Like