olefredrik / FoundationPress

FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb
https://foundationpress.olefredrik.com
MIT License
2.71k stars 869 forks source link

Question: Automate naming and packaging #1223

Closed breath-ee closed 6 years ago

breath-ee commented 6 years ago

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 commented 6 years ago

@breath-ee , check this: https://github.com/olefredrik/FoundationPress/issues/919 It could be useful, haven't tested it for a while, though.

knightknight commented 6 years ago

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

knightknight commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

Closing in favor of #1224