Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"clone-theme" command to help developers to get started with themes #798
So I wanted to get started building some themes, but I figured out I've to build "a skeleton" by my own.
Well, later I came with the idea to "create a skeleton theme" (which will contain ALL the minimal files required, which are around 3 files and 2 folders) to build a Ghost theme. However, later I figured out that this command was to "pull my basic theme" and just decompress it into the local folder so anyone can get started with it.
Starting from there, I figured out I could improve the command a little bit to actually use ANY available theme as "base" for your own theme. This is how
This command has some "tweaks" implemented, like detect if you're inside the root of your ghost installation, or maybe inside the "content" or "content/themes" folder, if so then the ghost/content/themes is the place where this script is going to install the theme for you. For other scenarios,
My goal is to build some basic re-usable base templates like a plain very minimalist (just 100% required files) theme, a bootstrap 4 based one and more.
The currently supported parameters are:
Your feedback is gold to me!
If you have any feedback on this please let me know, any sort of improvement I could make on this will help me to get involved with the Ghost community and improve the quality of the code I contribute to you guys.
We've talked about this a few times as an idea, and it's definitely something I'd love to see in Ghost-CLI :)
I would advocate for keeping it fairly minimal. Forking other themes as a base is a cool idea but I could also see it going wrong / causing issues. I think it's probably ok for that use-case to be more manual.
Statamic do a really good job of CLI based theme skeleton creation: https://www.youtube.com/watch?v=Uj5vvTUU3Sc
I seem to remember Laraval having a really nice starting point too (which makes sense, pretty sure
Also Ember-CLI does a nice job of stubbing new projects with a command
I like the idea of getting a skeleton theme
Agree to that. You can upload a theme in the admin client, pretty easy. Not sure about downloading any theme via the CLI
IMO command name could be discussed. Of course, it depends what the command will do at the end :)
How big is a skeleton zip?
If it's super small, which i guess so (?), I was wondering if we could just put the zip into the CLI as asset. Or into Ghost - for the beginning. Casper is 304kb, which is too big i find, but i guess we are not talking about using Casper as skeleton? Or are we?
This is actually something @ErisDS and I had discussed a while back - the idea we had was to create some sort of
ghost generate theme ? Name: my-theme-name
=> then you'd have a new theme :)
I'm more in favor of the generator approach for a couple of reasons:
This is great, awesome feedback!
I also liked the idea to keep it as simple as possible, but at the end not sure what is "minimal acceptable" as skeleton.
At the begining I was thinking about this:
^ that structure thinking of just covering the basic HTML schema and showing up the developer some of the capabilities to work with a theme.
@kirrg001 totally agree with the HUGE disadvantage of having to look for the .zip url, is not for everyone.
@acburdine I like the idea of using Yeoman as well, let me perform some research tonite to see what I can do.
Let's touch base on this so I can actually move forward and create something to start with, whatever you guys decide to go with: our own "HTML" hosted at ghost-cli, with or without yeoman, etc.
Default template suggestions look pretty good overall -- simplified version of casper files
I'm about to start working on this, but now the mandatory questions:
1.- Do we would like to use a CSS framework for this?
2.- Or maybe do we prefer to use an already built cross-compatible template?
3- Or do we wanna go with our own base? (Build a basic grid, image, text and responsive classes)
While I get some input on these responses, I'm going to work in the logic around the command to create the folder structure.
None of the above tbh, if this is supposed to be a development starting point then it's better not to start with a lot of stuff which people then have to remove. The only thing worth including is probably the CSS rest found in Casper:
referenced this pull request
Aug 25, 2018
While I wait for @ErisDS's feedback on that PR, I'm going to build the logic in Ghost-Cli to use yeoman generators from ghost-cli, that way ghost-cli is just going to be a sort of "proxy" for the generator and we only need to maintain the generator itself
TY everyone for your input, if you have any ideas to improve this, feel free to lmk.