ghost-on-heroku icon indicating copy to clipboard operation
ghost-on-heroku copied to clipboard

Add support for Theme upload

Open aayushdutt opened this issue 5 years ago • 45 comments

Due to the Ephimeral file system of Heroku, currently the admin panel doesn't support uploading the themes directly. If uploaded, the theme would go missing after some time. The only way to use custom theme currently is to commit your themes in the code files and then re publish the application. It would be good if we could add support for theme upload directly via the admin panel.

aayushdutt avatar Jun 27 '19 18:06 aayushdutt

Yes, you are absolutely right about the theme uploading issue. If you need to use this feature, I would recommend using AWS S3 as your file storage while building the application. I am still working on a viable way to enable theme uploads for free. If you have any service in mind, do share. Thank you.

SNathJr avatar Jun 28 '19 18:06 SNathJr

Integrating Cloud Storage could be a good option.

aayushdutt avatar Jun 28 '19 18:06 aayushdutt

Thank you. It looks promising. I will test it's integration with heroku in near future.

SNathJr avatar Jun 30 '19 09:06 SNathJr

Are you sure that in case of S3/Cloud Storage, the uploaded theme will not be stored in the file system? I guess S3 integration docs says it only serves the images image

aayushdutt avatar Jul 13 '19 14:07 aayushdutt

@aayushdutt My bad, I just verified that it does not support themes upload. I am looking into the Ghost-Storage-Base repository to make a storage adapter with themes storage enabled.

SNathJr avatar Aug 13 '19 11:08 SNathJr

Voting for this enhancement 👍🏼

codechair avatar Jan 22 '20 11:01 codechair

@codechair I still have not found a viable solution to this. Things either require paid subscriptions or do not support files other than static images. However, I will still be looking for other solutions (also considering to create a custom driver that syncs from remote on restart - such as a github private repo dump. But unless otherwise motivated, this will take time.)

SNathJr avatar Jan 23 '20 18:01 SNathJr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 30 '20 19:01 stale[bot]

Things either require paid subscriptions or do not support files other than static images.

S3 supports any file types. Not only images.

xjose97x avatar Feb 03 '20 21:02 xjose97x

Hey @xjose97x S3 does support all file types, however it requires you to have a paid AWS subscription, which many do not have.

S3 adapter of Ghost however does not seem to have support for storing themes on to S3, it just puts them in local storage.

SNathJr avatar Feb 07 '20 02:02 SNathJr

Is this issue also the reason my gatsby + netlify deployment shows the default theme while my Heroku deployment shows the active theme?

BadBrahmin avatar Feb 09 '20 12:02 BadBrahmin

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 16 '20 13:02 stale[bot]

+1

dwanderton avatar Mar 26 '20 05:03 dwanderton

You can clone a theme in local and edit as needed, push it to GitHub, and change the theme URL on the package.json file to your GitHub theme repo. Finally, deploy on Heroku.

"casper": "github:jerinjacob1999/Casper",

jerinjacob1999 avatar Apr 16 '20 14:04 jerinjacob1999

Great support @SNathJr Good job for this. I am using your button to build a ghost headless cms gatsby powered site. Working on it now.

stephenajulu avatar Apr 28 '20 07:04 stephenajulu

"uploading the themes directly. If uploaded, the theme would go missing after some time. "

I also encountered this. Does anyone know how to solve this? Is there any workaround for this?

Thanks in advance.

vyronarediano avatar May 01 '20 07:05 vyronarediano

You can clone a theme in local and edit as needed, push it to GitHub, and change the theme URL on the package.json file to your GitHub theme repo. Finally, deploy on Heroku.

"casper": "github:jerinjacob1999/Casper",

@vyronarediano

jerinjacob1999 avatar May 01 '20 07:05 jerinjacob1999

Hello @jerinjacob1999 , thanks for your response.

how did you get the "github:jerinjacob1999/Casper"? is that a repository link?

I purchased a theme recently, you mean I should upload the theme to Github like a create a repo of that theme?

vyronarediano avatar May 01 '20 10:05 vyronarediano

@vyronarediano Create a respority with your favourite theme and add new or update existing theme in package.json in root directory, if your are adding new one you should aslo edit copytheme.sh in bin folder

jerinjacob1999 avatar May 01 '20 10:05 jerinjacob1999

To use a new theme:

  1. Fork this repository
  2. Clone it and copy your theme in content/themes
  3. Remove content/themes/* from .gitignore
  4. Push the change
  5. Deploy

In case you wish to update existing deployment, follow updating-source-code instead of step 4 I think this should work @vyronarediano

aayushdutt avatar May 01 '20 10:05 aayushdutt

@vyronarediano Create a respority with your favourite theme and add new or update existing theme in package.json in root directory, if your are adding new one you should aslo edit copytheme.sh in bin folder

Ok. Thanks!

vyronarediano avatar May 01 '20 10:05 vyronarediano

To use a new theme:

  1. Fork this repository
  2. Clone it and copy your theme in content/themes
  3. Push the change
  4. Deploy

I think this should work @vyronarediano

Thanks for this @aayushdutt !! I will try this. Really appreciate your help :)

vyronarediano avatar May 01 '20 10:05 vyronarediano

Hello @aayushdutt,

image

What should be the value of my theme?

and as you said "Clone it and copy your theme in content/themes" - Is this in zip file format? or the extracted one? because upon uploading it in content/themes there were no changes to push. Only when I edit the package.json and copytheme.sh.

Many thanks in advance.

vyronarediano avatar May 01 '20 14:05 vyronarediano

@vyronarediano You should copy the extracted contents inside contents/themes. No other change is needed. If your new theme is named 'Editor', the folder should look like content/themes/Editor/...

aayushdutt avatar May 01 '20 23:05 aayushdutt

@vyronarediano You should copy the extracted contents inside contents/themes. No other change is needed. If your new theme is named 'Editor', the folder should look like content/themes/Editor/...

Alright, I see @aayushdutt. But by the way, when I did this, there were no changes to push in my git application.

Also, what would be the value of the theme in package.json (see screenshot above)?

Thanks

vyronarediano avatar May 02 '20 03:05 vyronarediano

As I said, no other change is needed. You don't need to change package.json at all. Just copy your theme and you are good to go.

aayushdutt avatar May 02 '20 03:05 aayushdutt

As I said, no other change is needed. You don't need to change package.json at all. Just copy your theme and you are good to go.

One last thing, what would be the value of the theme in package.json?

github:[username]/[name of the theme]?

vyronarediano avatar May 02 '20 03:05 vyronarediano

As I said, no other change is needed. You don't need to change package.json at all. Just copy your theme and you are good to go.

One last thing, what would be the value of the theme in package.json?

You don't need to change it. Just let it be what it is currently. You will be able to see your new theme in the Ghost Admin panel

aayushdutt avatar May 02 '20 03:05 aayushdutt

As I said, no other change is needed. You don't need to change package.json at all. Just copy your theme and you are good to go.

One last thing, what would be the value of the theme in package.json?

You don't need to change it. Just let it be what it is currently. You will be able to see your new theme in the Ghost Admin panel

Alright. Thank you so much for your help! Really appreciate it :)

vyronarediano avatar May 02 '20 03:05 vyronarediano

u should copy the extracted contents inside contents/themes. No other change is needed. If your new theme is named 'Editor', the folder should look like content/themes/Editor/...

Hello @aayushdutt, I just copied the theme and made the folder look like the one you said but there were no changes to commit and push.

image

vyronarediano avatar May 02 '20 11:05 vyronarediano