Make template site HTML5

It would really pain me if the default Jekyll site were XHTML. That'd be bad for the internet.

Instead, use Twitter Bootstrap as a base (while still keeping @mojombo's origin design), to give users a great initial baseline to build beautiful, simple sites.

Defaults are more than just the starting point. It's what 80% of users are going to use. Look at WordPress and the default theme. May as well lead by example and start the user off right.

* Add Bootstrap base CSS as a better reset and base layer
* Update default layout to HTML5 with boilerplate best practices
* Add title and post date to post.html (rather than including in the post itself)
* Make site title a variable and add to _config.yml
* Add page title to header
* Add default .gitignore to ignore `_site`
* Remove unused `rss.png` and `.gitkeep`
* Add Modernizr for legacy IE support
This commit is contained in:
Benjamin J. Balter 2013-04-13 13:15:31 -04:00
parent 485b37e3d1
commit 1163fa905e
15 changed files with 112 additions and 41 deletions

1
lib/site_template/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_site

View File

@ -1 +1,2 @@
name: Your New Jekyll Site
pygments: true pygments: true

View File

@ -1,38 +1,63 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<head> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<title>{{ page.title }}</title> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<!-- syntax highlighting CSS --> <head>
<link rel="stylesheet" href="/css/syntax.css" type="text/css" /> <meta charset="utf-8">
<!-- Homepage CSS --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" /> <title>{{ page.title }}</title>
</head> <meta name="viewport" content="width=device-width">
<body>
<div class="site"> <!-- Bootstrap base CSS -->
<div class="title"> <link rel="stylesheet" href="css/bootstrap.min.css">
<a href="/">Your Name</a> <link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<a class="extra" href="/">home</a>
</div> <!-- syntax highlighting CSS -->
<link rel="stylesheet" href="/css/syntax.css">
{{ content }}
<!-- Custom CSS -->
<div class="footer"> <link rel="stylesheet" href="/css/main.css">
<div class="contact">
<p> <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
Your Name<br /> </head>
What You Are<br /> <body>
your@email.com <!--[if lt IE 7]>
</p> <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
</div> <![endif]-->
<div class="contact">
<p> <div class="container">
<a href="http://github.com/yourusername/">github.com/yourusername</a><br /> <div class="site">
<a href="http://twitter.com/yourusername/">twitter.com/yourusername</a><br /> <div class="title">
</p> <a href="/">{{ site.name }}</a>
</div> <a class="extra" href="/">home</a>
</div> </div>
</div>
<a href="http://github.com/yourusername"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" /></a> {{ content }}
</body>
<footer>
<div class="contact">
<p>
Your Name<br />
What You Are<br />
your@email.com
</p>
</div>
<div class="contact">
<p>
<a href="http://github.com/yourusername/">github.com/yourusername</a><br />
<a href="http://twitter.com/yourusername/">twitter.com/yourusername</a><br />
</p>
</div>
</footer>
</div> <!-- /container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/main.js"></script>
</body>
</html> </html>

View File

@ -1,6 +1,9 @@
--- ---
layout: default layout: default
--- ---
<h2>{{ page.title }}</h2>
<p class="meta">{{ page.date | date_to_string }}</p>
<div id="post"> <div id="post">
{{ content }} {{ content }}
</div> </div>

File diff suppressed because one or more lines are too long

9
lib/site_template/css/bootstrap.min.css vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -115,7 +115,7 @@ ul.posts {
color: #aaa; color: #aaa;
} }
.site .footer { .site footer {
font-size: 80%; font-size: 80%;
color: #666; color: #666;
border-top: 4px solid #eee; border-top: 4px solid #eee;
@ -123,22 +123,22 @@ ul.posts {
overflow: hidden; overflow: hidden;
} }
.site .footer .contact { .site footer .contact {
float: left; float: left;
margin-right: 3em; margin-right: 3em;
} }
.site .footer .contact a { .site footer .contact a {
color: #8085C1; color: #8085C1;
} }
.site .footer .rss { .site footer .rss {
margin-top: 1.1em; margin-top: 1.1em;
margin-right: -.2em; margin-right: -.2em;
float: right; float: right;
} }
.site .footer .rss img { .site footer .rss img {
border: 0; border: 0;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

1
lib/site_template/js/main.js Executable file
View File

@ -0,0 +1 @@

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long