rename old default template to xhtml, update new default to lean html5

This commit is contained in:
Thomas Reynolds 2011-04-29 17:00:25 -07:00
parent f62283a02b
commit 358752272d
9 changed files with 148 additions and 5 deletions

View file

@ -29,6 +29,9 @@ end
# Default template
require "middleman/templates/default"
# XHMTL template
require "middleman/templates/xhtml"
# HTML5 template
require "middleman/templates/html5"

View file

@ -1,13 +1,21 @@
!!! Strict
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en" }
!!! 5
%html{ :lang => "en" }
%head
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
%meta{ :charset => "utf-8" }
/ Always force latest IE rendering engine (even in intranet) & Chrome Frame
%meta{ :content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible" }
/ Comment in layout
= stylesheet_link_tag "site.css"
:javascript
// Comment in javascript
= yield_content :head
%body{ :class => page_classes }
#frame
#main{ :role => "main" }
= yield

View file

@ -21,7 +21,7 @@ $blueprint-grid-margin: 20px
a
+link-colors($link-color, $link-hover-color, $link-focus-color, $link-active-color, $link-visited-color)
#frame
#main
padding: 50px
text-align: center
+container

View file

@ -0,0 +1,16 @@
class Middleman::Templates::Xhtml < Middleman::Templates::Base
def self.source_root
File.join(File.dirname(__FILE__), 'default')
end
def build_scaffold
template "config.tt", File.join(location, "config.rb")
template "config.ru", File.join(location, "config.ru")
directory "views", File.join(location, "views")
empty_directory File.join(location, "public", options[:css_dir])
empty_directory File.join(location, "public", options[:js_dir])
empty_directory File.join(location, "public", options[:images_dir])
end
end
Middleman::Templates.register(:xhtml, Middleman::Templates::Xhtml)

View file

@ -0,0 +1,4 @@
require 'rubygems'
require 'middleman'
run Middleman::Server

View file

@ -0,0 +1,68 @@
# CodeRay syntax highlighting in Haml
# activate :code_ray
# Automatic sitemaps (gem install middleman-slickmap)
# require "middleman-slickmap"
# activate :slickmap
# Automatic image dimension calculations
# activate :automatic_image_sizes
# Per-page layout changes
# With no layout
# page "/path/to/file.html", :layout => false
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
# Helpers
helpers do
def some_helper(*args)
"Helping"
end
end
<% if options[:css_dir] != "stylesheets" -%>
set :css_dir, "<%= options[:css_dir] -%>"
<% else -%>
# Change the CSS directory
# set :css_dir, "alternative_css_directory"
<% end -%>
<% if options[:js_dir] != "javascripts" -%>
set :js_dir, "<%= options[:js_dir] -%>"
<% else -%>
# Change the JS directory
# set :js_dir, "alternative_js_directory"
<% end -%>
<% if options[:images_dir] != "images" -%>
set :images_dir, "<%= options[:images_dir] -%>"
<% else -%>
# Change the images directory
# set :images_dir, "alternative_image_directory"
<% end -%>
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
# activate :minify_css
# Minify Javascript on build
# activate :minify_javascript
# Enable cache buster
# activate :cache_buster
# Use relative URLs
# activate :relative_assets
# Compress PNGs after build (gem install middleman-smusher)
# require "middleman-smusher"
# activate :smusher
# Generate ugly/obfuscated HTML from Haml
# activate :ugly_haml
# Or use a different image path
# set :http_path, "/Content/images/"
end

View file

@ -0,0 +1,4 @@
- content_for :head do
%title The Middleman!
%h1 The Middleman is watching.

View file

@ -0,0 +1,13 @@
!!! Strict
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en" }
%head
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
/ Comment in layout
= stylesheet_link_tag "site.css"
:javascript
// Comment in javascript
= yield_content :head
%body{ :class => page_classes }
#frame
= yield

View file

@ -0,0 +1,27 @@
@import "compass"
@import "blueprint"
$font-color: #2a2a2a
$link-color: #0388a6
$link-hover-color: #009ce0
$link-focus-color: $link-color
$link-active-color: $link-color
$link-visited-color: $link-color
$blueprint-font-family: 'Century Gothic', 'Apple Gothic', 'Helvetica Neue', arial, sans-serif
$blueprint-font-size: 13px
$blueprint-grid-columns: 12
$blueprint-grid-width: 60px
$blueprint-grid-margin: 20px
+global-reset
+blueprint-typography
a
+link-colors($link-color, $link-hover-color, $link-focus-color, $link-active-color, $link-visited-color)
#frame
padding: 50px
text-align: center
+container