Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use html5 boiler plate?

I am a newbie webdeveloper. Though, I understand what html5 boiler-plate brings to the table, I would like to know how can I extend/customize it to use it in all my html files?

As of now, it provides an index.html.

  1. So, what is the convention/method to create a new html file?
  2. Should I create a separate html folder?
  3. How do I inherit the properties of the index.html file?(Copy-paste?) Can't there be something like Django where I can inherit the baseurl?
  4. Though, I have some understanding of dealing with javascript and css, anything else I should take care of while dealing with html5 boiler plate and cross browser compatibility?
like image 254
Hick Avatar asked Apr 17 '12 19:04

Hick


1 Answers

In the beginning there is no real rhyme or reason to where you store your html files, because usually its just that plus some css file, or whatever.

However, when you get into real development, as in with a framework for front end + back end code, you will find that there is a need to separate things out as server side and public for the benefit of file access control and naming conventions.

When that is the case, you end up with an "Assets" folder, or "public" or something like that. Boilerplate tends to follow that convention.

In order to make boilerplate be automatically extended to all of your html files, you must develop your view files to be modular.

 Main template file
 |
 ----header (contains all the references / includes to boilerplate)
 ----content
 ----footer

Also, please note that at that point, your html will no longer be stored as .html file type; you must use a language that is capable of combining files as chunks. PHP does this nicely, and as you know, django can handle that as well. Ruby on rails, etc. you're gonna need to decide what language you want to work in for that. OTHERWISE, the old method of combining html chunks is server side includes (aka SSI or .shtml)

The issue of a base url is solved by having your server side language of choice work with the directives of your web server. For apache, you use mod_rewrite, and then you can pass an arg in the url that targets some classes / models / views, etc. MVC frameworks actually have already solved that problem for you, if you dont mind using one.

like image 181
Kristian Avatar answered Oct 05 '22 01:10

Kristian