Skip to content
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

Open
nickcernis opened this issue Dec 5, 2018 · 9 comments

Comments

@nickcernis
Copy link
Collaborator

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:

  • An npm run rename command that prompts people for the new name and replaces all genesis_sample strings and variants.
  • A theme generator presented as a website that offers a form and generation of a custom zip file, similar to https://underscores.me/ with more options.
@nathanrice
Copy link
Contributor

nathanrice commented Dec 5, 2018

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.

@nickcernis
Copy link
Collaborator Author

Sounds good. We could start with npm run rename, then potentially run that same command in an environment from the website to rename and generate custom themes.

@Original72
Copy link

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.

@seothemes
Copy link
Contributor

This looks useful https://www.npmjs.com/package/theme-claim

@mindctrl
Copy link
Contributor

Automattic open sourced the underscores.me site and generator here: https://github.com/Automattic/underscores.me

nickcernis added a commit that referenced this issue Mar 14, 2019
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).
nickcernis added a commit that referenced this issue Mar 14, 2019
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).
@jayhill90
Copy link

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

@nickcernis
Copy link
Collaborator Author

@jayhill90 Nice work! I found a couple of Sample strings still present, but otherwise this looks like a great start: jayhill90/genesis-generator#24

@jayhill90
Copy link

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.

@seothemes
Copy link
Contributor

Created a Node package for renaming/replacing strings - https://www.npmjs.com/package/genesis-theme-claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants