Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Question: Automate naming and packaging #1223

Closed
breath-ee opened this issue Feb 1, 2018 · 7 comments
Closed

Question: Automate naming and packaging #1223

breath-ee opened this issue Feb 1, 2018 · 7 comments
Labels

Comments

@breath-ee
Copy link

I'm not familiar with gulp to know how to change the code or if my idea is even worth changing! From my understanding is FoundationPress is a set of starter files, like underscores for WordPress. So I can take FoundationPress and rename it to my shiny new theme name.

However http://underscores.me/ has a generate page that will go through, theme name, slug, author, author uri, description and generate your parent starter theme zip package. I think it even rename the functions to your theme name as well. So is there a way of replicating this setup for FoundationPress for those who want use the starter files but under a different theme name?

Otherwise once I have git clone [...] my-new-theme, I then need to manually update styles.css and package.json with the new theme name. So given npm generates everything else could using the config.yml to automatically populate style.css details and change the package.json 'name' so when you npm run package you will get your new zipped theme named and generated. Rather then be left with the default foundationpress-[date].zip and if you have remebered to change the styles.css file.

I'm think this is more useful when you have finally finished developing you're parent theme and want to use versions numbers for updates after each npm run package.. I'm not totally sure if my thinking is even correct and I'm sure something like this has come up before, although I couldn't find reference to it. But FP with npm and gulp does such a good job of automating everything else apart from dealing with with those wanting use FoundationPress as SomethingElsePress.

@ghost
Copy link

ghost commented Feb 2, 2018

@breath-ee , check this: #919
It could be useful, haven't tested it for a while, though.

@knightknight
Copy link

@esarantanen, that is exactly what I was asking about! I'll check it out and see if it is still working. Thanks.

@knightknight
Copy link

The FoundationPress Generator still works. It managed to pull from the latest git and change the majority of the references to FoundationPress, leaving credits where they are due!

I still think for those doing full git pulls and having the config.yml do what the generator does would be better. Although I don't know if this is outside the scope of gulp and yaml!

@colin-marshall
Copy link
Collaborator

colin-marshall commented Feb 3, 2018

@knightknight it sounds like something that could be done with a gulp task and a search and replace plugin. No need for a WordPress plugin then.

@MrAndreius
Copy link

this is implemented in the croft theme

gulp renametheme This will rename all references to the theme text domain, function names and any other theme specific names. To use this task please make sure you change the THEME variable in gulpfile.js before running this task.

https://github.com/brettsmason/croft/blob/7ccca0ca18a0614f8ae24d08c9f40fa2df91a975/gulpfile.js#L148

@colin-marshall
Copy link
Collaborator

@MrAndreius looks like they use gulp-rename to accomplish this. If anybody wants to put in a PR for this it would be a great addition to this theme.

@colin-marshall
Copy link
Collaborator

Closing in favor of #1224

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

No branches or pull requests

4 participants