• This repository has been archived on 19/Jul/2020
  • Stars
    star
    133
  • Rank 272,600 (Top 6 %)
  • Language
    Shell
  • Created over 14 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple HTML5 site template to save me some time when starting a new site design/development.

Blank HTML5 Website Framework

The whole point of this is to abstract things I do over and over again when starting a new web design/development project. This reflects my workflow and may change over time because of that.

Production Recommendations

During development I work with multiple CSS files as needed, and multiple JS files for each part of the site or functionality. But when I move to production, I normally put together a build setup that optimizes the code for production.

You should have a build process that combines and minifies the CSS files, and combines and minifies your JS files as well. Remember Modernizr includes the HTML5 shim so you need to keep that in the head, but your production ready combined JS should be placed just before the closing </body> tag.

I personally use YUICompressor for CSS and Google Closure Compiler for JS.

Included Resources

It includes a few additional items by default:

  • HTML5 Reset Stylesheet by Richard Clark -- which was adapted from the Eric Myer's Reset CSS file.
  • Modernizr -- Which takes care of adding the HTML5 shim for IE in addition to providing a fantastic way to provide progressive enhancement for new features whose support is still spotty.
  • jQuery -- A local copy is included for development, then for production simply un-comment the Google CDN link and remove the local <script> tag.

File Layout

index.html
Readme.md                     
css/  
  - layout.css                // empty, just imports reset.css
  - reset.css
fonts/                        // empty, for storing web fonts
images/                       // empty, for all site images
js/
  - site.js                   // I almost always need at least one script file, this gets me started
  - lib/                      // External libraries and plugins should go here
      - jquery-1.4.2.min.js
      - modernizr-1.5.min.js

Using .js and .no-js helper classes

I use a convention in this template that starts the page load with a no-js class attached to html. (Update: Normally I have a snippet of code that does the swap from no-js to js, but thankfully Modernizr does this automatically if no-js exists!) In your CSS file, you can hide JS specific elements from non-JS enabled browsers or hide elements from browsers with JS enabled. By running this in the head, it changes up the page before it even renders, avoiding an awkward Flash of Unstyled Content (FOUS):

.no-js .collapsed { display: block; } /* Be sure blocks are hidden if JS is disabled */
.js    .collapsed { display: none;  } /* With JS enabled, hide these blocks. They will be shown via JS */

Optional Helper Shell Script

The site file is a helper script that will take care of setting up a new directory for you to start working on your new site. This script will first create the directory then export all the needed files (without the .git directory or any .git* files) to the new directory. This is the preferred method of utilizing this template framework.

You can use the site command via the command line, like this:

./site /path/to/new/site

You may need to mark this script as executable before using it:

chmod +x site

Finally, you can move this file to /usr/bin to use the site command from any directory. If you do this, be sure to uncomment the cd ~/Development... line and update the path to the location of this git repository on your local computer.

More Repositories

1

Downloadify

A tiny javascript + Flash library that enables the creation and download of text files without server interaction.
JavaScript
844
star
2

In-Field-Labels-jQuery-Plugin

This is a simple plugin that turns properly formatted HTML forms into forms with in-field label support. Labels fade when the field is focussed and disappear when text entry begins. Clearing a field and leaving brings back the label.
JavaScript
404
star
3

jQuery-Bling

Sample code used in a live coding presentation at Front End Design Conference.
JavaScript
98
star
4

TableOfContents

A flexible plugin that generates a Table of Contents based on the HTML markup of the web page
67
star
5

coach

Coach is a JavaScript Dribbble API Wrapper
JavaScript
12
star
6

amplify-streamline

A sample project used in the talk Streamlining Your AJAX Requests with AmplifyJS and jQuery
JavaScript
10
star
7

NicknameTabComplete

Tries to autocomplete when the tab key is pressed.
JavaScript
9
star
8

GData-to-JSON

A simple PHP script built on the Zend GData library for exporting a spreadsheet to JSON or PHP Array
PHP
6
star
9

dougneiner.docpad

Website to be hosted at code.dougneiner.com where I can blog about technical topics and resources. May eventually replace my primary tumblr.
CoffeeScript
6
star
10

html5-demo

A demo for jQuery Conference
JavaScript
5
star
11

Quotes-on-Design-Widget

A OS X Dashboard widget that interfaces with the soon to be announced Quotes on Design API v3.0
JavaScript
3
star
12

frontend-shop

A demo site for my talk at Front End Design Conference 2013
JavaScript
2
star
13

dougneiner.com

My personal website
Astro
1
star