@verythorough OK, I’ll start with something that doesn’t work.
I have a couple sites where I make extensive use of PHP include files for headers, footers, navigation, etc., along with a couple other simple PHP sections for “random” inclusion of content on each page. This is not WordPress, it’s basically a PHP version of what we used to be able to do with SHTML. (Aside: Why the powers who run HTML development have taken decades to add a simple tag to include HTML content the way we do images and other assets is beyond comprehension.)
If I was converting this to HTML locally, I would use something like
httrack to crawl this site on my local server and output HTML files instead of PHP files. The terminal command would be:
The trick is to duplicate this workflow remotely on Netlify.
The files are already on Github, so I spun up a new site in Netlify, linked it to my repository, and then added Brewfile.netlify with the following contents:
# 'brew install'
Netlify built this site, but did not translate the PHP files to HTML files, so I tried this:
# 'brew install'
I also included
httrack as a build command.
This time, Netlify started a deploy (two of them, actually), and spent five minutes doing next to nothing before I cancelled it.
It seems obvious that I need to load PHP and then scan the files in the repository with something that will translate them. What’s missing in my build chain is the web server. I could add
brew nginx so that
httrack has something to crawl, but that opens port :8080 by default, and as far as I can tell, the repository does not have a URL at which I can point
httrack. So, I think I can load each of the components, but I can’t figure out how to connect them so they talk to each other.
Unfortunately, I’ve never created a build command before (I create my static sites “by hand” – read “using BBEdit” – so they are ready to go no matter where I upload them), so I have no idea if I’m doing something wrong or if what I am trying to do is even possible.