3 ms·
What's the reason for this? Why don't you just build the website using standard HTML? Genuine question.
by newaccountfool 13y ago
What's the reason for this? Why don't you just build the website using standard HTML? Genuine question.
- mikegioia 13y agoThis allows you to include other html files from within your templates. Instead of writing out the same <nav> and <header> html in every single file, you can just `include 'nav.html'`
- eudox 13y agoTemplating.
- CJefferson 13y agoI was looking for something exactly like this just recently. Usually I use just php include when I want to just links some files together, but felt like I should stop using php as a preprocessor if possible. However, everything else is so complicated if all you want is simple file inclusion.
- newaccountfool 13y agoWhat's the reason behind not using PHP?
- mokkol 13y agoYou need PHP installed and configured on your server/local. With this you can just use plain HTML.
- kurrent 13y agoand by plain HTML, you mean plain Python installed and configured on your server/local
- mokkol 13y agoThe server doesnt need to have Python installed. Just your local machine. That is a simple one liner if it isnt already installed.
- icebraining 13y agoIn theory you could also use PHP as a pre-processor; install it locally, copy the sources to the webserver root, then use wget --mirror to extract a post-processed version of the site. You'd still need PHP installed on your home machine, but then again, it's not like you don't have to install some pre-processor anyway.
- cowsandmilk 13y ago> use wget --mirror to extract a post-processed version of the site. or just use php file.php > file.html
- icebraining 13y agoSure, but you'd need to process each file, or write a script to do it, when wget --mirror fetches the whole site at once.
- oneeyedpigeon 13y agoSecurity: if you're mega-paranoid or unwilling to keep up with patches, going static reduces your attack vector. Performance: your web server will be able to handle more traffic without the overhead of php. Of course, if you need any kind of dynamic processing on the server, you'll need to move beyond static pages.
- newaccountfool 13y agoAh ok, yeah now I totally understand :) Thought it was the whole 'Does any one even use PHP' getting thrown around again.
- mokkol 13y agopartials :-) try to have 1 header in like 10 pages. That is a lot of copy pasting :-)
- pbhjpbhj 13y agoI remember discovering SSI back when I was writing pages using pico/notepad .. was only a short hop then on to rejecting js client-side includes and using PHP for templating.