-
-
Notifications
You must be signed in to change notification settings - Fork 51
Themes #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If anyone wants to bring the themes PR down locally and do some testing that would be awesome. A theme should function like any other plenti site, so just pop it in your themes folder and reference it in the parent |
I've been going back and forth in my head quite a bit on how we should manage themes through the CLI tool. I wanted to provide a way to manage versions, however I knew most people creating simple sites would probably not git tag or create releases for different versions. In order to allow the maximum number of standard sites to be able to be used as themes (with no special setup on the maintainers part), I decided git commits could be used as version substitute. So I started updating the siteConfig struct to keep track of this info, which would look like this in your {
"build": "public",
"theme": {
"name": "plenti.co",
"url": "[email protected]:plentico/plenti.co",
"commit": "3c931c6d75e2a92fdaada896c5307c0845b2a74e"
},
"local": {
"port": 3000
},
"types": {
"pages": "/:filename"
}
} That led me to thinking that maybe we should update the command from something like
However, after starting to implement this and talking through it some more with @stephanieluz, we've decided this is a lot of added complexity for minimal value. First, I want to keep the I'm sure some folks may hate this decision and nothing is ever final, but we're trying to emphasize simplicity and productivity over order and perfection. If we can make something more accessible for the most common use-case, we're ok with it not being as robust in the edge cases as a tradeoff. |
I've been thinking more on this, so I figure I'll keep using this issue to think out loud in case anyone has thoughts they'd like to add. It would be helpful to add options to allow people to turn off inheritance on a particular aspect of a theme (assets, content, or layout). For example someone might want to leverage templates from a parent theme, but not have to override every single content page in that theme (or delete them in the parent theme every time they update). It would be nice to allow adding an option for this to "theme": {
"name": "plenti.co",
"url": "[email protected]:plentico/plenti.co",
"commit": "0eff8c7",
"content": false
}, I'm going to work this a bit more to hopefully see if I can find a good compromise between features and ease of use. I've added a way to resolve long or short commit hashes. It might also be nice to be able to pull zip files that aren't git versioned at all, although I'm not sure how necessary that would be. |
What about multiple themes? "themes": {
"plenti.co": {
"url": "[email protected]:plentico/plenti.co",
"commit": "0eff8c7"
},
"plenti-tags-example": {
"url": "[email protected]:jimafisk/plenti-tags-example.git",
"commit": "b8e6d17"
}
} Would we add an Basically this is all to avoid git submodules, but we don't want the solution to be more complicated than what we're initially trying to simplify. |
I think there needs to be two independent processes here:
A site could simply use the first process and completely omit the second (an enabled theme that isn't managed via Plenti CLI). A site could also use the second process without the first (several themes managed through the CLI, but none are enabled). A site could also leverage both processes (several themes are managed through the CLI, one of which is enabled). A "theme": "plenti.co",
"themes": {
"plenti.co": {
"url": "[email protected]:plentico/plenti.co",
"commit": "0eff8c7"
},
"plenti-tags-example": {
"url": "[email protected]:jimafisk/plenti-tags-example.git",
"commit": "b8e6d17"
}
} If those keys are too similar / nondescript, we could potentially use |
Considering the other options (like omitting assets, content, or the layout folder) for the 2nd process outlined above, maybe a better key name would be: We also might want flags in the CLI to automate this: Edit: We're going with |
Proposed commands:
|
Might be nice to eventually add promptui to allow folks to run commands without the theme argument and take user input (e.g. |
Needed to delete the |
The |
There are some issues using the |
Themes are now out in the wild with the |
Uh oh!
There was an error while loading. Please reload this page.
Picking up the discussion on themes started here: #19
It would be nice to have a command for adding themes, for example:
plenti new theme [email protected]:jimafisk/my-theme.git
. This should download the git repo into athemes/
folder and could even make an entry inplenti.json
in order to keep track of what theme is currently being used + could allow checking for updates on the remote repo.Maybe also add a flag to the
new site
command, e.g.plenti new site MY_SITE --theme=REPO.git
. This should run the --bare flag in the background.The text was updated successfully, but these errors were encountered: