Iâ€™m a big fan of the popular HTML5 Boilerplate. Iâ€™d love to use the build script to minifiy etc, but I canâ€™t figure out how to get everything working together. To add further fun, I deploy using Git â€“ no FTP.
Paul Irishâ€™s video on using the build script is great, and at the end he shows a way to deploy on a server, then use .htaccess to reroot traffic from .com/ to .com/published/site/ â€“ however that doesnâ€™t really work when youâ€™ve got a webapp and youâ€™re using views. Itâ€™s also a really bad habit to put any code in public_html.
So hereâ€™s the structure Iâ€™m after of the deployed and built site:
- webapp - app - classes - welcome.php - views - template.php - framework - public_html - index.php - css - js - img
But it needs to:
- Be still able to develop locally, without having to build every time!
- Be Gitable â€“ deploy to server, then build
- Minify and read views from webapp
My first attempt ended up like this:
- webapp - app - classes - welcome.php - views - template.php - framework - public_html - index.php - css (minified) - js (minified) - img (minified) - dev_html - index.php - build - etc... - css - js - img
Then I published back up, but then completely forgot about the fact that the HTML file that needs reading is in the webapp, so then I get stuck.
Itâ€™s a bit complicated so do ask if you donâ€™t get it!
Michellâ€™s suggestion of using CodeIgniter/HTML5 Boilerplate by Serkan SÃ¶kmen is pretty close, but the problem is that it publishes it to a folder within itself, which if you published on a server (after deploy via Git), would mean the app is in public_html â€“ bad for security.
Iâ€™ve started a topic about it in the issues at HTML5 Boilerplate if anybodyâ€™s interested. Not figure it out yet: https://github.com/paulirish/html5-boilerplate/issues/558
Iâ€™ve created a GitHut repo for the files Iâ€™ve changed: https://github.com/thomasedwards/h5bp-publish-tree
It pretty much works the way I intended it to, might be worth something to somebody.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki