-
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 rename script #278
base: develop
Are you sure you want to change the base?
Add rename script #278
Conversation
Thanks for this, @seothemes. I like the interactive approach: As you predicted, there are still several “sample” strings left after running Do you think the |
@nickcernis it will definitely handle all of the string replacements. I’ll get it updated tomorrow to include those files that it missed. I’m not sure about version numbers though, maybe it would be better to use something like bump-regex to allow the version to be bumped independently. |
I was thinking more that, if someone's using Genesis Sample as a new theme for a project, it's undesirable to have all version numbers reading 3.0.1 (instead of 0.1.0 or 1.0.0), and all |
@nickcernis ok, I've bumped Genesis Theme Claim to version 0.3.0 which replaces all strings and resets the version number. Ready for you to take a look. |
Nice work, @seothemes! Resetting versions to 1.0.0 is a great touch. I found a few tiny 'Sample' strings still remaining in file/function names (ignore the Should we delete the genesis-sample.pot file too? (An alternative might be to delete all existing *.pot files in the makepot script before creating a new one, which would recreate it with the correct filename the next time I suppose someone might expect the changelog to be wiped for a new theme too, but they can update this themselves pretty easily. Apart from that, it looks great. Thank you again for all the work that went into this. |
@nickcernis updated to 0.4.0 which adds a new function to rename the POT file and WooCommerce CSS file. I wasn't able to find any "sample" strings after running the latest script. Have also added a changelog reset function which should reset it to something like this: # My Theme Changelog
## [1.0.0] - (current date)
* Initial commit. Is there anything else you can think of to improve it further? |
Great job! The only two things I found with a new theme string of “Genesis NewTheme” were:
genesis-new-theme-woocommerce.css But it's enqueued as (
We should probably just change the src to use
Both are probably edge cases to do with the “NewTheme” string. I'm otherwise happy to merge this pending approval from one more reviewer. |
Would it be better to just rename the stylesheet to For the POT file, that is expected. To have |
Good idea.
If you run
There's also an inconsistency between the Theme Name (“Genesis New Theme” in the stylesheet instead of the entered “Genesis NewTheme”), and the text domain (“genesis-newtheme”). It likely relates to the UpperCamelCase, so it's an edge case we could log and don't have to solve for immediately. |
and in woocommerce stylesheet header
Thanks, |
Ok, 0.5.0 is ready for testing. I've fixed the file renaming issue - the strings are no longer split by capital letters. Only spaces are used as delimiters now. For example: The string "BK Theme" will create a I've also added a new function to rename the actual theme directory. It follows the same rules as above. @bharath 1 & 3 are fixed with ea5241b and 8ce5656. Make sure you test with this branch to get the latest commits. |
I am using new theme string of "BK Child" for testing.
and in woocommerce stylesheet comment
|
@bharath 2 should be fixed with 0.6.0 ^ |
Everything works good. Great work @seothemes |
Have these conflicts ever got resolved and merged to current develop? I do need the feature to rename the theme. |
I've created a node package to rename strings in the theme based on the theme claim package mentioned here.
Installation:
Save as a dev dependency:
Usage:
Run the following command and follow the CLI instructions:
I've probably missed a few strings but the bulk of it is working. Some of the things it renames:
Things to consider adding: