How to use html5 boiler plate?
Asked Answered
C

3

6

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?
Chaffer answered 17/4, 2012 at 19:30 Comment(0)
O
7

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.

Opportune answered 17/4, 2012 at 19:34 Comment(1)
Any particular links/books that you can refer me to, to read more about this? (Modular templating and using PhP to do what you just suggested. I am comfortable in Django doing that, but not yet in this)Chaffer
P
0

"You can override what folders and files you want to operate on in project.properties. All the default configuration is in default.properties." http://html5boilerplate.com/docs/Build-script/

default.properties is in /build/config

You need to add the pages to the line that starts with "file.pages", like this:

file.pages = new-page.html"

Punke answered 25/6, 2012 at 22:29 Comment(0)
S
-1

The core of HTML5 Boilerplate

  • HTML — A guide to the default HTML.
  • CSS — A guide to the default CSS.
  • JavaScript — A guide to the default JavaScript.
  • .htaccess — All about the Apache web server config (also see our alternative server configs).
  • crossdomain.xml — An introduction to making use of crossdomain requests.
  • Everything else.
Sharice answered 10/11, 2012 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.