-
Notifications
You must be signed in to change notification settings - Fork 279
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
Add script or theme generator to make child theme renaming and customisation easier #142
Comments
I actually like both approaches, and don't think we should exclude either one, necessarily. But we do likely need to prioritize. We can throw both of them in our backlog and let @bryankennedysmith help us make that decision. |
Sounds good. We could start with |
This would be an outstanding feature to be able to automatically rename any of the StudioPress child theme names thought a script or a website theme generator. All my custom design sites are started with Genesis Sample and even when a client wants to use a StudioPress child theme I still rename the theme because eventually, I know they are going to want something customized about the website. |
This looks useful https://www.npmjs.com/package/theme-claim |
Automattic open sourced the underscores.me site and generator here: https://github.com/Automattic/underscores.me |
CHILD_THEME_NAME is no longer required as of Genesis 2.9.0. It was previously used to set the footer credit text and as the handle for the enqueued stylesheet. In Genesis 2.9.0 the name is now pulled from the Theme Name header for the site footer, and a sanitized version of the same value is used as the stylesheet handle. See studiopress/genesis#2166. The CHILD_THEME_HANDLE constant is used instead for enqueueing scripts and styles. Where a human-readable name is needed (admin notices), it is pulled directly from the stylesheet Theme Name line. The goal is to reduce the number of places where people need to set their theme name and version number. The sanitized Name is used for the CHILD_THEME_HANDLE instead of the Text Domain because we have often seen modified Genesis Sample themes where the name is changed but the text domain is not. We could switch to the Text Domain once this is implemented: #142. It's also likely that we'll switch away from constants and use helper functions should those become available in Genesis. This would offer better cache-busting during development, where assets can change often but version strings do not. studiopress/genesis#2199 (comment).
CHILD_THEME_NAME is no longer required as of Genesis 2.9.0. It was previously used to set the footer credit text and as the handle for the enqueued stylesheet. In Genesis 2.9.0 the name is now pulled from the Theme Name header for the site footer, and a sanitized version of the same value is used as the stylesheet handle. See studiopress/genesis#2166. The CHILD_THEME_HANDLE constant is used instead for enqueueing scripts and styles. Where a human-readable name is needed (admin notices), it is pulled directly from the stylesheet Theme Name line. The goal is to reduce the number of places where people need to set their theme name and version number. The sanitized Name is used for the CHILD_THEME_HANDLE instead of the Text Domain because we have often seen modified Genesis Sample themes where the name is changed but the text domain is not. We could switch to the Text Domain once this is implemented: #142. It's also likely that we'll switch away from constants and use helper functions should those become available in Genesis. This would offer better cache-busting during development, where assets can change often but version strings do not. studiopress/genesis#2199 (comment).
I hacked together this last plugin last night. It adds a wp-cli command for Genesis, grabs genesis-sample-master and updates the things. Having some trouble with Author and URI stuff but the slug transformations appear to work. https://github.com/jayhill90/genesis-generator |
@jayhill90 Nice work! I found a couple of Sample strings still present, but otherwise this looks like a great start: jayhill90/genesis-generator#24 |
Thanks @nickcernis! I've gotten that sorted out now. Definitely some more improvements to be made but this should help people starting from a scratch Genesis Sample theme. |
Created a Node package for renaming/replacing strings - https://www.npmjs.com/package/genesis-theme-claim |
If Genesis Sample is to be widely used as the starting point for custom Genesis child themes, it would be helpful to have a way to rename the theme more easily.
Common approaches are:
npm run rename
command that prompts people for the new name and replaces all genesis_sample strings and variants.The text was updated successfully, but these errors were encountered: