Screenshot-2023-06-16-at-2.38.40-PM

Beginning again, and a better WordPress child-theme scaffold

Starting a new project I realized I really did not like my normal development cycle for how to keep my code clean and tracked, and not load junk into a live server. Because no one likes seeing their gulpfile on a child theme, I decided to re-work my method.

For starters, I need gulp scss and linting

For my preferred development method, I like to work in gulp, with git tracking, and on a local server (local). That being said. you don’t really have great options for keeping your code separate from local to prevent uploading all that noise to a live server. So I have previously been running rsyncs and copying code, and really just not doing anything efficiently because there was no need really. But I had a chance to work on a site from scratch that gave me a fresh look at what I was doing, and the moment I went to type npm install, I stopped and decided to build something better. A scaffold, so I only do this once.

Problems this scaffold solves:

  1. This is for multiple projects, working on multiple computers.
  2. Those computers don’t always store things in the same folders.
  3. I don’t want my local info on a git repository, especially since I may hand these off at some point.
  4. I need to pull different parent themes for this child theme scaffold.
  5. I may need to change branding for different clients.

Ok, so that’s a couple reasons I needed to build out some variables that can re-use, change once, and keep moving. My solution: gulp, gulp-replace, and a .env file. All of my locations are set up as variables in gulp, all of my names are set up as variables in gulp. Each project needs some customization per computer or project, so I can drop a few names in a .env folder in the same way I might hide an api key. Not really the most elaborate use of a .env setup, but this will save me a lot of time later per project.

Have a project to work on?

Let’s talk about it. I don’t charge for quotes, and I’m happy to customize a plan to make sure we can get your project done.