updated to latest octopress

This commit is contained in:
Brandon Mathis 2011-09-21 15:43:34 -05:00
parent 480b60ddf1
commit 98d2b410fe
18 changed files with 132 additions and 126 deletions

View File

@ -41,7 +41,7 @@ body {
max-width: $max-width;
position: relative;
margin: 0 auto;
> header, > nav, > footer, #content > article, #content > div > article, #content > div > section, nav[role=pagination] {
> header, > nav, > footer, #content > article, #content > div > article, #content > div > section, nav.pagination {
@extend .group;
padding-left: $pad-min;
padding-right: $pad-min;
@ -67,7 +67,7 @@ body {
#content { > div, > article { width: 100%; }}
aside[role=sidebar] {
aside.sidebar {
float: none;
padding: 0 $pad-min 1px;
background-color: lighten($sidebar-bg, 2);
@ -88,7 +88,7 @@ aside[role=sidebar] {
body.sidebar-footer {
@media only screen and (min-width: 750px) {
aside[role=sidebar]{ @include collapse-sidebar; }
aside.sidebar{ @include collapse-sidebar; }
}
#content { margin-right: 0px; }
.toggle-sidebar { display: none; }
@ -98,7 +98,7 @@ body.sidebar-footer {
body > header { font-size: 1em; }
}
@media only screen and (min-width: 750px) {
aside[role=sidebar] { @include collapse-sidebar; }
aside.sidebar { @include collapse-sidebar; }
}
@media only screen and (min-width: 768px) {
body { -webkit-text-size-adjust: auto; }
@ -120,7 +120,7 @@ body.sidebar-footer {
float: left;
}
}
aside[role=sidebar] {
aside.sidebar {
@extend .group;
width: $sidebar-width-medium - $sidebar-pad-medium*2;
padding: 0 $sidebar-pad-medium $sidebar-pad-medium;
@ -147,7 +147,7 @@ body.sidebar-footer {
padding-bottom: $pad-wide/2;
}
}
aside[role=sidebar] {
aside.sidebar {
width: $sidebar-width-wide - $sidebar-pad-wide*2;
padding: 1.2em $sidebar-pad-wide $sidebar-pad-wide;
.collapse-sidebar & {

View File

@ -60,7 +60,7 @@ $page-border-bottom: darken($footer-bg, 5) !default;
a {
@include link-colors($link-color, $hover: $link-color-hover, $focus: $link-color-hover, $visited: $link-color-visited, $active: $link-color-active);
}
aside[role=sidebar] a {
aside.sidebar a {
@include link-colors($sidebar-link-color, $hover: $sidebar-link-color-hover, $focus: $sidebar-link-color-hover, $active: $sidebar-link-color-active);
}
a {

View File

@ -86,7 +86,7 @@ del, s { text-decoration: line-through; }
abbr, acronym { border-bottom: 1px dotted; cursor: help; }
pre, code, tt { @extend .mono-font; }
pre, code, tt { @extend .mono; }
sub, sup { line-height: 0; }

View File

@ -121,7 +121,7 @@ article + article {
display: inline-block;
}
#content nav[role=pagination] {
#content nav.pagination {
text-align: center;
font-size: .95em;
div {

View File

@ -31,8 +31,8 @@ body > nav {
}
}
}
fieldset[role=site-search]{ float: right; width: 48%; }
fieldset[role=mobile-nav]{ float: left; width: 48%;
fieldset[role=search]{ float: right; width: 48%; }
fieldset.mobile-nav{ float: left; width: 48%;
select{ width: 100%; font-size: .8em; border: 1px solid #888;}
}
ul { display: none; }
@ -44,7 +44,7 @@ body > nav {
display: block;
padding-top: .15em;
}
ul[role=subscription] {
ul.subscription {
margin-left: .8em;
float: right;
li:last-child a { padding-right: 0; }
@ -85,8 +85,8 @@ body > nav {
width: $sidebar-width-medium - $pad-medium*2 - $sidebar-pad-medium - 58px;
.search { width: 91%; }
}
fieldset[role=mobile-nav] { display: none; }
fieldset[role=site-search]{ width: 99%; }
fieldset.mobile-nav { display: none; }
fieldset[role=search]{ width: 99%; }
}
@media only screen and (min-width: 992px) {
form {
@ -130,7 +130,7 @@ body > nav {
}
}
}
ul[role=subscription] { position: relative; top: .2em; li, a { border: 0; padding: 0; }}
ul.subscription { position: relative; top: .2em; li, a { border: 0; padding: 0; }}
a[rel=subscribe-rss]{ @include mask-subscription-nav('rss.png'); }
a[rel=subscribe-email]{ @include mask-subscription-nav('email.png'); }
}

View File

@ -177,7 +177,7 @@ li code {
.s1 { color: $solar-cyan !important; } /* Literal.String.Single */
//.ss { color: #990073 } /* Literal.String.Symbol */
//.il { color: #009999 } /* Literal.Number.Integer.Long */
div { .gd, .gd .x, .gi, .gi .x { display: block; }}
div { .gd, .gd .x, .gi, .gi .x { display: inline-block; width: 100%; }}
}
.highlight, .gist-highlight {
@ -201,7 +201,7 @@ pre, .highlight, .gist-highlight {
}
.highlight code { @extend .pre-code; background: #000;}
figure[role=code] {
figure.code {
background: none;
padding: 0;
border: 0;

View File

@ -1,7 +1,7 @@
.side-shadow-border {
@include box-shadow(lighten($sidebar-bg, 5) 0 1px);
}
aside[role=sidebar] {
aside.sidebar {
color: $sidebar-color;
text-shadow: lighten($sidebar-bg, 8) 0 1px;
a { @extend .force-wrap; }

View File

@ -6,7 +6,12 @@
<h1 class="entry-title">{{ page.title | titlecase }}</h1>
{% endif %}
{% unless page.meta == false %}
<p class="meta">{% include post/date.html %}{{ time }}</p>
<p class="meta">
{% include post/date.html %}{{ time }}
{% if site.disqus_short_name and page.comments != false and site.disqus_show_comment_count == true %}
| <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread">Comments</a>
{% endif %}
</p>
{% endunless %}
</header>
{% endunless %}

View File

@ -1,7 +1,7 @@
{% if site.delicious_user %}
<section>
<h1>On Delicious</h1>
<script type="text/javascript" src="http://feeds.delicious.com/v2/js/{{ site.delicious_user }}?title=&count={{ site.delicious_count }}&sort=date&extended"></script>
<script type="text/javascript" src="http://feeds.delicious.com/v2/js/{{ site.delicious_user }}?title=&amp;count={{ site.delicious_count }}&amp;sort=date&amp;extended"></script>
<p><a href="http://delicious.com/{{ site.delicious_user }}">My Delicious Bookmarks &raquo;</a></p>
</section>
{% endif %}

View File

@ -0,0 +1,22 @@
{% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %}
{% if site.disqus_short_name and page.comments != false %}
<script type="text/javascript">
(function () {
var disqus_shortname = '{{ site.disqus_short_name }}';
{% if page.comments == true %}
{% comment %} `page.comments` can be only be set to true on pages/posts, so we embed the comments here. {% endcomment %}
// var disqus_developer = 1;
var disqus_identifier = '{{ site.url }}{{ page.url }}';
var disqus_url = '{{ site.url }}{{ page.url }}';
var disqus_script = 'embed.js'
{% else %}
{% comment %} As `page.comments` is empty, we must be on the index page. {% endcomment %}
var disqus_script = 'count.js'
{% endif %}
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
{% endif %}

View File

@ -4,27 +4,25 @@
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>{% if page.title %}{{page.title}} - {% endif %}{{site.title}}</title>
<meta name="author" content="{{site.author}}">
{% if page.description %}
<meta name="description" content="{{page.description}}"/>
{% endif %}
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title>
<meta name="author" content="{{ site.author }}">
{% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
<meta name="description" content="{{ description | strip_newlines | strip_html | truncate:150 }}">
{% if page.keywords %}<meta name="keywords" content="{{ page.keywords }}">{% endif %}
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if page.keywords %}
<meta name="keywords" content="{{page.keywords}}"/>
{% endif %}
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
<link rel="canonical" href="{{ canonical }}">
<link href="{{ root_url }}/favicon.png" rel="shortcut icon" />
<link href="{{ root_url }}/favicon.png" rel="icon">
<link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<script src="{{ root_url }}/javascripts/modernizr-2.0.js"></script>
<script src="http://s3.amazonaws.com/ender-js/jeesh.min.js"></script>
<script src="{{ root_url }}/javascripts/octopress.js" type="text/javascript"></script>
<link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml"/>
<link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml">
{% include custom/head.html %}
</head>

View File

@ -1,11 +1,11 @@
<ul role=subscription data-subscription="rss{% if site.subscribe_email %} email{% endif %}">
<ul class="subscription" data-subscription="rss{% if site.subscribe_email %} email{% endif %}">
<li><a href="{{ site.subscribe_rss }}" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
{% if site.subscribe_email %}
<li><a href="{{ site.subscribe_email }}" rel="subscribe-email" title="subscribe via email">Email</a></li>
{% endif %}
</ul>
<form action="{{ site.simple_search }}" method="get">
<fieldset role="site-search">
<fieldset role="search">
<input type="hidden" name="q" value="site:{{ site.url | shorthand_url }}" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>

View File

@ -1,13 +1 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_short_name }}';
var disqus_identifier = '{{ site.url }}{{ page.url }}';
var disqus_url = '{{ site.url }}{{ page.url }}';
//var disqus_developer = 1;
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

View File

@ -1,14 +1,15 @@
{% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
{% include head.html %}
<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %}>
<header>{% include header.html %}</header>
<nav role=navigation>{% include navigation.html %}</nav>
<header role="banner">{% include header.html %}</header>
<nav role="navigation">{% include navigation.html %}</nav>
<div id="main">
<div id="content">
{{ content | expand_urls: root_url }}
</div>
</div>
<footer>{% include footer.html %}</footer>
<footer role="contentinfo">{% include footer.html %}</footer>
{% include disqus.html %}
{% include google_analytics.html %}
{% include google_plus_one.html %}
{% include twitter_sharing.html %}

View File

@ -3,7 +3,7 @@ layout: default
---
<div>
<article>
<article role="article">
{% if page.title %}
<header>
<h1 class="entry-title">{{ page.title | titlecase }}</h1>
@ -27,12 +27,12 @@ layout: default
{% if site.disqus_short_name and page.comments == true %}
<section>
<h1>Comments</h1>
<div id="disqus_thread">{% include post/disqus_thread.html %}</div>
<div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div>
</section>
{% endif %}
</div>
{% unless page.sidebar == false %}
<aside role=sidebar>
<aside class="sidebar">
{% if site.page_asides.size %}
{% include_array page_asides %}
{% else %}

View File

@ -4,7 +4,7 @@ single: true
---
<div>
<article class="hentry">
<article class="hentry" role="article">
{% include article.html %}
<footer>
<p class="meta">
@ -17,15 +17,15 @@ single: true
{% endunless %}
</footer>
</article>
{% if site.disqus_short_name and page.comments != false %}
{% if site.disqus_short_name and page.comments == true %}
<section>
<h1>Comments</h1>
<div id="disqus_thread">{% include post/disqus_thread.html %}</div>
<div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div>
</section>
{% endif %}
</div>
{% unless page.sidebar == false %}
<aside role=sidebar>
<aside class="sidebar">
{% if site.post_asides.size %}
{% include_array post_asides %}
{% else %}

View File

@ -3,37 +3,26 @@ layout: default
---
<div class="blog-index">
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article>
{% include article.html %}
</article>
{% endfor %}
<nav role="pagination">
<div>
{% if paginator.next_page %}
<a class="prev" href="{{paginator.next_page}}">&larr; Older</a>
{% endif %}
<a href="/blog/archives">Blog Archives</a>
{% if paginator.previous_page %}
<a class="next" href="{{paginator.previous_page}}">Newer &rarr;</a>
{% endif %}
</div>
</nav>
{% if site.disqus_short_name %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_short_name }}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endif %}
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article>
{% include article.html %}
</article>
{% endfor %}
<nav class="pagination">
<div>
{% if paginator.next_page %}
<a class="prev" href="{{paginator.next_page}}">&larr; Older</a>
{% endif %}
<a href="/blog/archives">Blog Archives</a>
{% if paginator.previous_page %}
<a class="next" href="{{paginator.previous_page}}">Newer &rarr;</a>
{% endif %}
</div>
</nav>
</div>
<aside role=sidebar>
<aside class="sidebar">
{% if site.blog_index_asides.size %}
{% include_array blog_index_asides %}
{% else %}

View File

@ -1,38 +1,40 @@
function getNav(){
var mobileNav = $('nav[role=navigation] fieldset[role=site-search]').after('<fieldset role="mobile-nav"></fieldset>').next().append('<select></select>');
function getNav() {
var mobileNav = $('nav[role=navigation] fieldset[role=search]').after('<fieldset class="mobile-nav"></fieldset>').next().append('<select></select>');
mobileNav.children('select').append('<option value="">Navigate&hellip;</option>');
$($('ul[role=main-navigation] a')).each(function(link) {
mobileNav.children('select').append('<option value="'+link.href+'">&bull; '+link.text+'</option>')
$('ul.main-navigation a').each(function(link) {
mobileNav.children('select').append('<option value="'+link.href+'">&bull; '+link.text+'</option>');
});
mobileNav.children('select').bind('change', function(event){
mobileNav.children('select').bind('change', function(event) {
if (event.target.value) window.location.href = event.target.value;
});
}
function addSidebarToggler() {
$('#content').append('<span class="toggle-sidebar"></span>');
$('.toggle-sidebar').bind('click', function(e){
$('.toggle-sidebar').bind('click', function(e) {
e.preventDefault();
if($('body').hasClass('collapse-sidebar')){
if ($('body').hasClass('collapse-sidebar')) {
$('body').removeClass('collapse-sidebar');
} else {
$('body').addClass('collapse-sidebar');
}
});
sections = $('aside[role=sidebar] > section')
if(sections.length > 1){
var sections = $('aside.sidebar > section');
if (sections.length > 1) {
sections.each(function(section, index){
if ((sections.length >= 3) && index % 3 == 0) {
if ((sections.length >= 3) && index % 3 === 0) {
$(section).addClass("first");
}
count = ((index +1) % 2) ? "odd" : "even";
var count = ((index +1) % 2) ? "odd" : "even";
$(section).addClass(count);
});
}
if(sections.length >= 3){ $('aside[role=sidebar]').addClass('thirds') }
if (sections.length >= 3){ $('aside.sidebar').addClass('thirds'); }
}
function testFeatures() {
var features = ['maskImage'];
$(features).map(function(feature){
$(features).map(function(feature) {
if (Modernizr.testAllProps(feature)) {
$('html').addClass(feature);
} else {
@ -46,59 +48,60 @@ function testFeatures() {
}
}
function addCodeLineNumbers(){
if (navigator.appName == 'Microsoft Internet Explorer') { return }
$('div.gist-highlight').each(function(code){
var tableStart = '<table cellpadding="0" cellspacing="0"><tbody><tr><td class="gutter">';
var lineNumbers = '<pre class="line-numbers">';
var tableMiddle = '</pre></td><td class="code" width="100%">';
var tableEnd = '</td></tr></tbody></table>';
var count = $('div.line', code).length;
for (i=1;i<=count; i++){
lineNumbers += '<span class="line">'+i+'</span>\n';
function addCodeLineNumbers() {
if (navigator.appName == 'Microsoft Internet Explorer') { return; }
$('div.gist-highlight').each(function(code) {
var tableStart = '<table><tbody><tr><td class="gutter">',
lineNumbers = '<pre class="line-numbers">',
tableMiddle = '</pre></td><td class="code">',
tableEnd = '</td></tr></tbody></table>',
count = $('span.line', code).length;
for (var i=1;i<=count; i++) {
lineNumbers += '<span class="line-number">'+i+'</span>\n';
}
table = tableStart + lineNumbers + tableMiddle + '<pre>'+$('pre', code).html()+'</pre>' + tableEnd;
var table = tableStart + lineNumbers + tableMiddle + '<pre>'+$('pre', code).html()+'</pre>' + tableEnd;
$(code).html(table);
});
}
function flashVideoFallback(){
var flashplayerlocation = "/assets/jwplayer/player.swf",
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
$('video').each(function(video){
video = $(video);
if(!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") != -1){
video.children('source[src$=mp4]').first().map(function(source){;
if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") != -1){
video.children('source[src$=mp4]').first().map(function(source){
var src = $(source).attr('src'),
id = 'video_'+Math.round(1 + Math.random()*(100000)),
width = video.attr('width'),
height = parseInt(video.attr('height')) + 30;
video.after('<div class="flash-video"><div><div id='+id+'>');
id = 'video_'+Math.round(1 + Math.random()*(100000)),
width = video.attr('width'),
height = parseInt(video.attr('height'), 10) + 30;
video.after('<div class="flash-video"><div><div id='+id+'>');
swfobject.embedSWF(flashplayerlocation, id, width, height + 30, "9.0.0",
{ file : src, image : video.attr('poster'), skin : flashplayerskin } ,
{ movie : src, wmode : "opaque", allowfullscreen : "true" });
{ movie : src, wmode : "opaque", allowfullscreen : "true" }
);
});
video.remove();
}
});
}
function wrapFlashVideos(){
$('object').each(function(object){
function wrapFlashVideos() {
$('object').each(function(object) {
object = $(object);
if(object.children('param[name=movie]')){
if (object.children('param[name=movie]')) {
var wrapper = object.before('<div class="flash-video"><div>').previous();
$(wrapper).children().append(object);
}
});
$('iframe[src*=vimeo],iframe[src*=youtube]').each(function(iframe){
$('iframe[src*=vimeo],iframe[src*=youtube]').each(function(iframe) {
iframe = $(iframe);
var wrapper = iframe.before('<div class="flash-video"><div>').previous();
$(wrapper).children().append(iframe);
});
}
$.domReady(function(){
$.domReady(function() {
testFeatures();
wrapFlashVideos();
flashVideoFallback();
@ -113,17 +116,17 @@ $.domReady(function(){
// Source url: https://gist.github.com/901295
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
function fix() {
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
doc.removeEventListener(type, fix, true);
}
if ((meta = meta[meta.length - 1]) && addEvent in doc) {
fix();
scales = [.25, 1.6];
scales = [0.25, 1.6];
doc[addEvent](type, fix, true);
}
}(document));