Closed codechair closed 4 years ago
Hey @codechair So, my first guess off the top of my head would be that, the deployment script is replacing your edited theme. Maybe you can try removing the theme's dependency from package.json and copy themes shell file as well. Let us know how it goes.
Cheers! SNathJr
Thanks a ton for reverting so quickly @SNathJr
I get removing the dependency from package.json
Can you clarify what you mean with "copy themes shell file as well" please?
Oh, I am sorry for not being specific. It's the copy-themes.sh
file in bin
folder.
Also, make sure you put your edited theme in content/themes
folder.
Thanks and how do I make the contents in content/themes
be readable?
Changes to them right now do not show up as changes in Github. So I can't commit them.
@codechair Try with the .gitignore file. There would be content/themes/*
.
Also, if you would not want to do all that, you could simply create your own fork of the theme and point to that theme in the dependancy. That would be a better approach, as well.
Super ultra thanks @SNathJr ! Priceless help... 4h of my day ended up rescued by you :)
For others in the future going through the same (just as per suggestion from above from @SNathJr) The following worked:
package.json
(obs the path to your theme fork would be here)copy-themes.sh
file in bin folder..gitignore
file (as opposed to content/themes/*
)
content/themes/attila
content/themes/bleak
content/themes/casper
content/themes/london
content/themes/massively
content/themes/pico
content/themes/the-shell
content/themes/vapor
And to follow-up on your final note @SNathJr , sadly the fork only "worked" upon the first npm install --production
all subsequent changes to the theme did not propagate. See the second part of "To reproduce" in https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437. I was working with a fork of the theme all along. This bit was the strangest of it all (only updating the markup the first time I've deployed a dependency - or changed the dependency - . I kept on moving between my fork and Ghost's original theme to confirm this and yes, the custom markup only changed/rendered if I'd move the dependency back to Ghost's theme repo and then back to my fork of the theme again).
Or did I misunderstand you with "fork of the theme"?
the fork only "worked" upon the first npm install --production
@codechair well, that would be because, as we say time and time again, Heroku does NOT persist anything locally outside of what's already in your slug.
So the ONLY way to get this to persist every single time would be to just point Lyra (or whatever theme) to your own theme (e.g. "Lyra": "github:codechair/my-lyra-fork"
), then copy-themes.sh
will handle the rest.
Do you have at least one "release" in your forked theme repository?
@SNathJr we've had to repeat ourselves about Heroku not persisting any local file changes (including themes) again and again and again. We really should 1. update "bug" reports template to point anyone regarding this to #9, 2. add documentation, 3. aggressively close any issue about this. Maybe it might also be a good idea to explain in the README how heroku works (only the slug is persisted) and tell people to debug their own stuff (e.g. "if something only works the first time, chances are, it's not part of the slug")
Thanks for reverting @JaneJeon, I believe you misunderstood me.
I was pointing all dependencies to my own fork of the theme (See the second part of "To reproduce" in #https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437). So, unsure what you mean?
@codechair
@JaneJeon
Just redid it all again and here it comes "all dependencies" was a typo as indeed this is about one dependency (this was also clear from my "To Reproduce" https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437):
the forked theme: https://github.com/codechair/lyra-forked
the pointing to the dependency: https://github.com/codechair/ghost-on-heroku/blob/master/package.json
Then the process to lock package-lock.json
as per https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437 "To reproduce"
@JaneJeon I believe, @codechair needed help with how the repo works, and how github handles gitignore and gitkeep.
As far as I understand, @codechair wants to edit lyra theme in their fork and was not able to load it on deploy.
This was probably because of gitignore file ignoring content/themes
and replacing it with original theme from tryghost. (@codechair correct me if I am wrong).
The solution was hence to create their own fork of theme with wanted changes and add it to dependencies. Or to add it in the folder manually and remove the code that replaces it.
The scope of this ticket should have been support (not bug).
This was probably because of gitignore file ignoring
content/themes
and replacing it with original theme from tryghost. (@codechair correct me if I am wrong).
@SNathJr the funny part of this is that the original content would not completely override the theme, the changes from the first part of "To reproduce" https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437 would persist on and on, but any new changes (second part of "To reproduce" https://github.com/SNathJr/ghost-on-heroku/issues/44#issue-554258437 ) would not propagate.
@JaneJeon Being at work, I believe I did not read that fully and assumed @codechair needed help with replacing the theme with their edited version. 😅
Also, closing this issue as it seems to have been solved by the OP.
@SNathJr funny you should say that, I'm also at work xD
Getting back to this issue:
I had solved the issue by reading the theme files directly from my fork of this repo as per kind guidance from @SNathJr .
I'm however struggling with this approach now given I still need to do styling changes in the separate theme (Lyra) fork (in assets > css
), then build the screen.css
in assets > built
with yarn
, then manually copy those files over to the theme now living in my fork of this repo.
That is a lot of back and forth.
Any chance you'd have any idea on how to actually read from the separate theme fork without suffering from the inconsistencies I've referred to on the first comment to this issue?
I'm not opening a new issue since this history is very relevant to why I've moved to using the theme files in the repo.
And as a clean way to replicate what I've mentioned top of this thread, I'm prepared the repos so you can have a look at, clean:
the forked theme: https://github.com/codechair/lyra-forked
the pointing to the dependency: https://github.com/codechair/ghost-on-heroku/blob/master/package.json
Then the process to lock package-lock.json as per #44 (comment) "To reproduce"
Hey @codechair
I am not sure that I understand your question properly. Could you please be a little bit more specific? Maybe give a step by step procedure of what you were doing and what went wrong.
SNathJr
Sure @SNathJr , here it comes:
Describe the bug I cannot update the theme if:
To Reproduce
This is when things NO longer propagate:
Expected behavior Be able to change the theme via my forked theme of a supported Ghost Theme (i.e. Lyra). In other words, to be able to customise "GhostifiedTheme" and have the changes propagate
How are you deploying this? Deployment on Heroku from fork of this repo
Please let me know if you’d like any other details.
Ignore what I said previously. @codechair I believe I have already mentioned to you above that a possible solution is to version your theme. However, you still not have tried it and AFAIK it is a surefire way to update the theme within heroku.
To version your theme, you MUST make a new GitHub release and update the specific version number.
As for @snathjr, I believe we need to explicitly say we do not support developing (or specifically, what this guy wants - “hot reposing”) on heroku. Your repo and theme must be prepped locally and then pushed up.
Describe the bug I cannot update the theme (nothing at all, not even a simple removal of the link to Facebook on footer).
To Reproduce
default.hbs
) in "GhostifiedTheme"package.json
in "Ghostified" (look fordependencies
-->lyra
)npm install --production
to updatepackage-lock.json
This is when things NO longer propagate:
default.hbs
to also remove the Twitter linknpm install --production
to updatepackage-lock.json
package-lock.json
point to the latest commit on "GhostifiedTheme", so runnpm update lyra
,package-lock.json
will now point to the latest commit on "GhostifiedTheme"Expected behavior Be able to change the theme via my forked theme of a supported Ghost Theme (i.e. Lyra). In other words, to be able to customise "GhostifiedTheme" and have the changes propagate
How are you deploying this? Deployment on Heroku from fork of this repo