Hacker News new | past | comments | ask | show | jobs | submit login

I have been considering using php like that. It would solve most of my issues. The problem is that I would still like to use static hosts, like netlify or GitHub pages, and they don't support php...In addition I would have to run php on my local machine, where as I would prefer to just edit html with no setup necessary. But if anyone knows a good free host with php support, let me know!



You can run PHP in GitHub with the GitHub Actions to generate a static HTML site hosted in GitHub Pages.

So you can edit your HTML push and have a simple script to clean it before publishing it.

You can copy my blog is very simple and is generated with PHP

https://github.com/4lb0/blog


Your solution is quite nice and probably as simple as site generators get, but I was thinking of using php just for some simple includes etc. Here's my inspiration post which explains what I'm after, and why generators in general are not the solution (for me): http://ankarstrom.se/~john/articles/html2/


You could also frankenstein a front page with some js fetch. Dont even have to parse the includes. Just split and append.


If you are willing to use netlify and are willing to use PHP, what is the inhibition to use a static site generator like Hugo? It is supported by netlify and others. I believe GitHub pages also supports a bunch of static site generators.


I am using 11ty for the blog, and it works great, for now. But there's two reasons I don't like it:

1. I need to have two different versions of my site, dev and prod, which I find very restricting and fragile.

2. I don't like to rely on other people updating their npm packages just so I could publish static content. I've been burned too many times by abandoned npm packages or breaking changes.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: