Browse Source

Redesign, etc..

unreleased_contents
Blagovest Petrov 11 years ago
parent
commit
adc7d47183
  1. 8
      _config.yml
  2. 8
      sass/_base.scss
  3. 8
      sass/_partials.scss
  4. 240
      sass/base/_layout.scss
  5. 141
      sass/base/_theme.scss
  6. 138
      sass/base/_typography.scss
  7. 44
      sass/base/_utilities.scss
  8. 55
      sass/custom/_colors.scss
  9. 3
      sass/custom/_styles.scss
  10. 49
      sass/partials/_blog.scss
  11. 22
      sass/partials/_syntax.scss
  12. 16
      sass/screen.scss
  13. 6
      source/_includes/after_footer.html
  14. 43
      source/_includes/archive_post.html
  15. 59
      source/_includes/article.html
  16. 28
      source/_includes/asides/github.html
  17. 8
      source/_includes/asides/recent_posts.html
  18. 3
      source/_includes/custom/after_footer.html
  19. 18
      source/_includes/custom/footer.html
  20. 3
      source/_includes/custom/head.html
  21. 6
      source/_includes/custom/header.html
  22. 2
      source/_includes/custom/navigation.html
  23. 2
      source/_includes/disqus.html
  24. 20
      source/_includes/google_analytics.html
  25. 47
      source/_includes/head.html
  26. 58
      source/_includes/header.html
  27. 20
      source/_includes/navigation.html
  28. 8
      source/_includes/post/categories.html
  29. 32
      source/_includes/post/sharing.html
  30. 2
      source/_includes/twitter_sharing.html
  31. 21
      source/_layouts/category_index.html
  32. 37
      source/_layouts/default.html
  33. 38
      source/_layouts/page.html
  34. 67
      source/_layouts/post.html
  35. 27
      source/blog/archives/index.html
  36. 32
      source/index.html
  37. 3179
      source/javascripts/libs/jquery.min.js
  38. 104
      source/javascripts/octopress.js
  39. 152
      source/javascripts/twitter.js

8
_config.yml

@ -3,7 +3,7 @@
# ----------------------- # # ----------------------- #
url: http://eniac111.github.io url: http://eniac111.github.io
title: Blago's blog title: Blagovest Petrov
subtitle: Just another junk of words about IT subtitle: Just another junk of words about IT
author: Blagovest Petrov author: Blagovest Petrov
simple_search: http://google.com/search simple_search: http://google.com/search
@ -12,8 +12,8 @@ description: The personal blog of Blagovest Petrov
navigation: navigation:
- text: Home # - text: Home
url: /index.html # url: /index.html
- text: $whoami? - text: $whoami?
url: /about-me.html url: /about-me.html
@ -30,7 +30,7 @@ navigation:
date_format: "ordinal" date_format: "ordinal"
# RSS / Email (optional) subscription links (change if using something like Feedburner) # RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml subscribe_rss: http://feeds.feedburner.com/BlagosBlog
subscribe_email: subscribe_email:
# RSS feeds can list your email address if you like # RSS feeds can list your email address if you like
email: email:

8
sass/_base.scss

@ -1,5 +1,5 @@
@import "base/utilities"; @import "base/color";
@import "base/solarized"; @import "base/font";
@import "base/theme";
@import "base/typography";
@import "base/layout"; @import "base/layout";
@import "base/typography";
@import "base/utilities";

8
sass/_partials.scss

@ -1,8 +1,2 @@
@import "partials/header";
@import "partials/navigation";
@import "partials/blog";
@import "partials/sharing";
@import "partials/syntax"; @import "partials/syntax";
@import "partials/archive"; @import "partials/blog";
@import "partials/sidebar";
@import "partials/footer";

240
sass/base/_layout.scss

@ -1,192 +1,50 @@
$max-width: 1200px !default; $max-width: 1000px;
// Padding used for layout margins *{
$pad-min: 18px !default; margin: 0;
$pad-narrow: 25px !default; padding: 0;
$pad-medium: 35px !default; }
$pad-wide: 55px !default; body{
font-family: $font-default;
// Sidebar widths used in media queries font-weight: 300;
$sidebar-width-medium: 240px !default; font-size: 14px;
$sidebar-pad-medium: 15px !default; background: $color-background;
$sidebar-pad-wide: 20px !default; background-image: url("../images/sativa.png");
$sidebar-width-wide: 300px !default; color: $color-gray01;
@media screen and (max-width: 1040px){
$indented-lists: false !default; margin: 0 20px;
}
$header-font-size: 1em !default; @media screen and (max-width: 600px){
$header-padding-top: 1.5em !default; font-size: 13px;
$header-padding-bottom: 1.5em !default; }
}
.group { @include pie-clearfix; } h1{
font-size: 1.8em;
@mixin collapse-sidebar { }
float: none; h2{
width: auto; font-size: 1.5em;
clear: left; }
margin: 0; h3{
padding: 0 $pad-medium 1px; font-size: 1.3em;
background-color: lighten($sidebar-bg, 2); }
border-top: 1px solid lighten($sidebar-border, 4); a{
section { text-decoration: none;
&.odd, &.even { float: left; width: 48%; } outline-width: 0;
&.odd { margin-left: 0; } color: $color-main;
&.even { margin-left: 4%; } }
} .alignleft{
&.thirds section { float: left;
width: 30%; }
margin-left: 5%; .alignright{
&.first { float: right;
margin-left: 0; }
clear: both; .clearfix{
} @include pie-clearfix;
} }
} .inner{
width: $max-width;
body { margin: 0 auto;
-webkit-text-size-adjust: none; @media screen and (max-width: 1040px){
max-width: $max-width; width: 100%;
position: relative; }
margin: 0 auto;
> header, > nav, > footer, #content > article, #content > div > article, #content > div > section {
@extend .group;
padding-left: $pad-min;
padding-right: $pad-min;
@media only screen and (min-width: 480px) {
padding-left: $pad-narrow;
padding-right: $pad-narrow;
}
@media only screen and (min-width: 768px) {
padding-left: $pad-medium;
padding-right: $pad-medium;
}
@media only screen and (min-width: 992px) {
padding-left: $pad-wide;
padding-right: $pad-wide;
}
}
div.pagination {
@extend .group;
margin-left: $pad-min;
margin-right: $pad-min;
@media only screen and (min-width: 480px) {
margin-left: $pad-narrow;
margin-right: $pad-narrow;
}
@media only screen and (min-width: 768px) {
margin-left: $pad-medium;
margin-right: $pad-medium;
}
@media only screen and (min-width: 992px) {
margin-left: $pad-wide;
margin-right: $pad-wide;
}
}
> header {
font-size: $header-font-size;
padding-top: $header-padding-top;
padding-bottom: $header-padding-bottom;
}
}
#content {
overflow: hidden;
> div, > article { width: 100%; }
}
aside.sidebar {
float: none;
padding: 0 $pad-min 1px;
background-color: lighten($sidebar-bg, 2);
border-top: 1px solid $sidebar-border;
@extend .group;
}
.flex-content { max-width: 100%; height: auto; }
.basic-alignment {
&.left { float: left; margin-right: 1.5em; }
&.right { float: right; margin-left: 1.5em; }
&.center { display:block; margin: 0 auto 1.5em; }
&.left, &.right { margin-bottom: .8em; }
}
.toggle-sidebar { &, .no-sidebar & { display: none; }}
body.sidebar-footer {
@media only screen and (min-width: 750px) {
aside.sidebar{ @include collapse-sidebar; }
}
#content { margin-right: 0px; }
.toggle-sidebar { display: none; }
}
@media only screen and (min-width: 550px) {
body > header { font-size: $header-font-size; }
}
@media only screen and (min-width: 750px) {
aside.sidebar { @include collapse-sidebar; }
} }
#main, #content, .sidebar {
@extend .group;
}
@media only screen and (min-width: 768px) {
body { -webkit-text-size-adjust: auto; }
body > header { font-size: $header-font-size * 1.2; }
#main {
padding: 0;
margin: 0 auto;
}
#content {
overflow: visible;
margin-right: $sidebar-width-medium;
position: relative;
.no-sidebar & { margin-right: 0; border-right: 0; }
.collapse-sidebar & { margin-right: 20px; }
> div, > article {
padding-top: $pad-medium/2;
padding-bottom: $pad-medium/2;
float: left;
}
}
aside.sidebar {
width: $sidebar-width-medium - $sidebar-pad-medium*2;
padding: 0 $sidebar-pad-medium $sidebar-pad-medium;
background: none;
clear: none;
float: left;
margin: 0 -100% 0 0;
section {
width: auto; margin-left: 0;
&.odd, &.even { float: none; width: auto; margin-left: 0; }
}
.collapse-sidebar & {
@include collapse-sidebar;
}
}
}
@media only screen and (min-width: 992px) {
body > header { font-size: $header-font-size * 1.3; }
#content { margin-right: $sidebar-width-wide; }
#content {
> div, > article {
padding-top: $pad-wide/2;
padding-bottom: $pad-wide/2;
}
}
aside.sidebar {
width: $sidebar-width-wide - $sidebar-pad-wide*2;
padding: 1.2em $sidebar-pad-wide $sidebar-pad-wide;
.collapse-sidebar & {
padding: { left: $pad-wide; right: $pad-wide; }
}
}
}
@if $indented-lists == false {
@media only screen and (min-width: 768px) {
ul, ol { margin-left: 0; }
}
}

141
sass/base/_theme.scss

@ -1,85 +1,92 @@
$color-dark: #272727 !default;
$color-emph: #00585f !default;
$color-light: #b0bf5a !default;
$color-none: #fefefe !default;
$color-simple: #a6a6a6 !default;
$noise-bg: image-url('noise.png') top left !default; $noise-bg: image-url('noise.png') top left !default;
$img-border: inline-image('dotted-border.png') !default; $img-border: inline-image('dotted-border.png') !default;
// Main Link Colors
$link-color: lighten(#165b94, 3) !default; $link-color: lighten(#165b94, 3) !default;
$link-color-hover: adjust-color($link-color, $lightness: 10, $saturation: 25) !default;
$link-color-visited: adjust-color($link-color, $hue: 80, $lightness: -4) !default;
$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default;
// Main Section Colors
$main-bg: #f8f8f8 !default;
$page-bg: #252525 !default;
$article-border: #eeeeee !default;
$header-bg: #333 !default; // global color setup
$header-border: lighten($header-bg, 15) !default;
$title-color: #f2f2f2 !default;
$subtitle-color: #aaa !default;
$text-color: #222 !default; body {
$text-color-light: #aaa !default; background-color: $color-none;
$type-border: #ddd !default; color: $color-dark;
@include selection($color-emph, $color-none);
}
.content {
overflow: hidden;
}
/* Navigation */ .entry-content {
$nav-bg: #ccc !default; a {
$nav-bg-front: image-url('noise.png') !default; color: $color-dark;
$nav-bg-back: linear-gradient(lighten($nav-bg, 8), $nav-bg, darken($nav-bg, 11)) !default; border-bottom: 2px dashed $color-dark;
$nav-color: darken($nav-bg, 38) !default; @include transition(0.5s);
$nav-color-hover: darken($nav-color, 25) !default; }
$nav-placeholder: desaturate(darken($nav-bg, 10), 15) !default; a:hover {
$nav-border: darken($nav-bg, 10) !default; color: $color-light;
$nav-border-top: lighten($nav-bg, 15) !default; border-bottom: 2px dashed $color-light;
$nav-border-bottom: darken($nav-bg, 25) !default; }
$nav-border-left: darken($nav-bg, 11) !default; }
$nav-border-right: lighten($nav-bg, 7) !default;
/* Sidebar colors */ #main > footer {
$sidebar-bg: #f2f2f2 !default; background-color: $color-dark;
$sidebar-link-color: $link-color !default; color: $color-none;
$sidebar-link-color-hover: $link-color-hover !default; @include selection($color-light, $color-none);
$sidebar-link-color-active: $link-color-active !default; }
$sidebar-color: change-color(mix($text-color, $sidebar-bg, 80), $hue: hue($sidebar-bg), $saturation: saturation($sidebar-bg)/2) !default;
$sidebar-border: desaturate(darken($sidebar-bg, 7), 10) !default;
$sidebar-border-hover: darken($sidebar-bg, 7) !default;
$sidebar-link-color-subdued: lighten($sidebar-color, 20) !default;
$sidebar-link-color-subdued-hover: $sidebar-link-color-hover !default;
$footer-color: #888 !default; #sidebar {
$footer-bg: #ccc !default; background-color: $color-dark;
$footer-bg-front: image-url('noise.png') !default; color: $color-none;
$footer-bg-back: linear-gradient(lighten($footer-bg, 8), $footer-bg, darken($footer-bg, 11)) !default; @include selection($color-light, $color-none);
$footer-color: darken($footer-bg, 38) !default; a {
$footer-color-hover: darken($footer-color, 10) !default; color: $color-light;
$footer-border-top: lighten($footer-bg, 15) !default; }
$footer-border-bottom: darken($footer-bg, 15) !default; a:hover {
$footer-link-color: darken($footer-bg, 38) !default; color: $color-none;
$footer-link-color-hover: darken($footer-color, 25) !default; }
$page-border-bottom: darken($footer-bg, 5) !default; h1 a {
color: $color-none;
}
h1 a:hover {
color: $color-light;
}
}
a {
color: $color-simple;
@include transition(0.5s);
}
a:hover {
color: $color-light;
}
/* Core theme application */ .articlemeta {
background-color: $color-emph;
}
.articlemeta,
.articlemeta a {
color: $color-none;
}
a { .articlemeta:hover {
@include link-colors($link-color, $hover: $link-color-hover, $focus: $link-color-hover, $visited: $link-color-visited, $active: $link-color-active); background-color: $color-dark;
} }
aside.sidebar a {
@include link-colors($sidebar-link-color, $hover: $sidebar-link-color-hover, $focus: $sidebar-link-color-hover, $active: $sidebar-link-color-active); #disqus_thread {
border-top: 0.2em solid $color-emph;
} }
a {
@include transition(color .3s); h1, h1 a, h1 a:hover {
color: $color-emph;
} }
html { .entry-title a {
background: $page-bg image-url('line-tile.png') top left; color: $color-dark;
} }
body { .entry-title a:hover {
> div { color: $color-light;
background: $sidebar-bg $noise-bg;
border-bottom: 1px solid $page-border-bottom;
> div {
background: $main-bg $noise-bg;
border-right: 1px solid $sidebar-border;
}
}
} }

138
sass/base/_typography.scss

@ -1,131 +1,3 @@
$blockquote: $type-border !default;
$sans: "PT Sans", "Helvetica Neue", Arial, sans-serif !default;
$serif: "PT Serif", Georgia, Times, "Times New Roman", serif !default;
$mono: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace !default;
$heading-font-family: "PT Serif", "Georgia", "Helvetica Neue", Arial, sans-serif !default;
$header-title-font-family: $heading-font-family !default;
$header-subtitle-font-family: $heading-font-family !default;
// Fonts
.heading {
font-family: $heading-font-family;
}
.sans { font-family: $sans; }
.serif { font-family: $serif; }
.mono { font-family: $mono; }
body > header h1 {
font-size: 2.2em;
@extend .heading;
font-family: $header-title-font-family;
font-weight: normal;
line-height: 1.2em;
margin-bottom: 0.6667em;
}
body > header h2 {
font-family: $header-subtitle-font-family;
}
body {
line-height: 1.5em;
color: $text-color;
@extend .serif;
}
h1 {
font-size: 2.2em;
line-height: 1.2em;
}
@media only screen and (min-width: 992px) {
body { font-size: 1.15em; }
h1 { font-size: 2.6em; line-height: 1.2em; }
}
#{headings()}{
@extend .heading;
text-rendering: optimizelegibility;
margin-bottom: 1em;
font-weight: bold;
}
h2, section h1 {
font-size: 1.5em;
}
h3, section h2, section section h1 {
font-size: 1.3em;
}
h4, section h3, section section h2, section section section h1 {
font-size: 1em;
}
h5, section h4, section section h3 {
font-size: .9em;
}
h6, section h5, section section h4, section section section h3 {
font-size: .8em;
}
p, article blockquote, ul, ol { margin-bottom: 1.5em; }
ul { list-style-type: disc;
ul { list-style-type: circle; margin-bottom: 0px;
ul { list-style-type: square; margin-bottom: 0px; }}}
ol { list-style-type: decimal;
ol { list-style-type: lower-alpha; margin-bottom: 0px;
ol { list-style-type: lower-roman; margin-bottom: 0px; }}}
ul, ol { &, ul, ol { margin-left: 1.3em; }}
ul, ol { ul, ol { margin-bottom: 0em; }}
strong { font-weight: bold; }
em { font-style: italic; }
sup, sub { font-size: 0.75em; position: relative; display: inline-block; padding: 0 .2em; line-height: .8em;}
sup { top: -.5em; }
sub { bottom: -.5em; }
a[rev='footnote']{ font-size: .75em; padding: 0 .3em; line-height: 1; }
q { font-style: italic;
&:before { content: "\201C"; }
&:after { content: "\201D"; }
}
em, dfn { font-style: italic; }
strong, dfn { font-weight: bold; }
del, s { text-decoration: line-through; }
abbr, acronym { border-bottom: 1px dotted; cursor: help; }
pre, code, tt { @extend .mono; }
hr { margin-bottom: 0.2em; }
small { font-size: .8em; }
big { font-size: 1.2em; }
article blockquote {
$bq-margin: 1.2em;
font-style: italic;
position: relative;
font-size: 1.2em;
line-height: 1.5em;
padding-left: 1em;
border-left: 4px solid rgba($text-color-light, .5);
cite {
font-style: italic;
a { color: $text-color-light !important; word-wrap: break-word; }
&:before { content: '\2014'; padding:{right: .3em; left: .3em;} color: $text-color-light; }
}
@media only screen and (min-width: 992px) {
padding-left: 1.5em;
border-left-width: 4px;
}
}
.pullquote-right:before, .pullquote-right:before,
.pullquote-left:before { .pullquote-left:before {
/* Reset metrics. */ /* Reset metrics. */
@ -152,13 +24,3 @@ article blockquote {
float: left; float: left;
margin: .5em 1.5em 1em 0; margin: .5em 1.5em 1em 0;
} }
/* @extend this to force long lines of continuous text to wrap */
.force-wrap {
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
word-wrap: break-word;
}

44
sass/base/_utilities.scss

@ -1,28 +1,24 @@
@mixin mask-image($img, $repeat: no-repeat){ @mixin square($property){
@include experimental(mask-image, image-url($img), -webkit, -moz, -o, -ms); width: $property;
@include experimental(mask-repeat, $repeat, -webkit, -moz, -o, -ms); height: $property;
width: image-width($img);
height: image-height($img);
} }
@mixin user-select($select){
@mixin shadow-box($border: #fff .5em solid, $shadow: rgba(#000, .15) 0 1px 4px, $border-radius: .3em) { -moz-user-select: $select;
@include border-radius($border-radius); -khtml-user-select: $select;
@include box-shadow($shadow); -webkit-user-select: $select;
@include box-sizing(border-box); -o-user-select: $select;
border: $border; user-select: $select;
} }
@mixin border-shadow($top: $color-gray05, $bottom: $color-gray04){
@mixin selection($bg, $color: inherit, $text-shadow: none){ border-top: 1px solid $top;
* { border-bottom: 1px solid $bottom;
&::-moz-selection { background: $bg; color: $color; text-shadow: $text-shadow; }
&::-webkit-selection { background: $bg; color: $color; text-shadow: $text-shadow; }
&::selection { background: $bg; color: $color; text-shadow: $text-shadow; }
}
} }
@mixin center($width, $height){
@function text-color($color, $dark: dark, $light: light){ position: absolute;
$text-color: ( (red($color)*299) + (green($color)*587) + (blue($color)*114) ) / 1000; top: 50%;
$text-color: if($text-color >= 150, $dark, $light); left: 50%;
@return $text-color; margin-left: $width/(-2);
margin-top: $height/(-2);
width: $width;
height: $height;
} }

55
sass/custom/_colors.scss

@ -1,18 +1,43 @@
// Customize the colors of Octoflat Here // Here you can easily change your sites's color scheme.
// To give it a try, uncomment some of the lines below rebuild your blog, and see how it works.
// If you need a handy color picker try http://hslpicker.com
/* Remove this line for the light theme / for custom colors //$header-bg: #263347;
//$subtitle-color: lighten($header-bg, 58);
//$nav-bg: desaturate(lighten(#8fc17a, 18), 5);
//$nav-bg-front: image-url('noise.png');
//$nav-bg-back: linear-gradient(lighten($nav-bg, 8), $nav-bg, darken($nav-bg, 11));
//$sidebar-bg: desaturate(#eceff5, 8);
//$sidebar-link-color: saturate(#526f9a, 10);
//$sidebar-link-color-hover: darken(#7ab662, 9);
//$footer-bg: #ccc !default;
//$footer-bg-front: image-url('noise.png');
//$footer-bg-back: linear-gradient(lighten($footer-bg, 8), $footer-bg, darken($footer-bg, 11));
$primary-color: #e69411; // Jumbotron, Horizontal Rules, Headings
$secondary-color: #1dbbd6; // Tags, Links, Main Heading, Quote Border
$tertiary-color: #C0392B; // Hover-over color, Active Page color
$accent-color1: #23defe; // Hover-over background color for tags
$accent-color2: #34495E; // Sub-headings, Date Stamp
$accent-color3: #ffffff; // Navbar Text, Tag text
$bg-color: #ffffff; // Background
$navbar-color: #1ec2de; // Navbar
$code-bg-color: #2C3E50; // Code background
$quote-color: #E74C3C; // Quote Color
$text-color: #5a5e5f; // Body Text
$footer-color: #7F8C8D; // Footer
And remove this line */ /* To use the dark Solarized highlighting theme comment the following line and line 29 */
$solarized: light;
/* If you want to tweak the Solarized colors you can do that here */
//$base03: #002b36; //darkest blue
//$base02: #073642; //dark blue
//$base01: #586e75; //darkest gray
//$base00: #657b83; //dark gray
//$base0: #839496; //medium gray
//$base1: #93a1a1; //medium light gray
//$base2: #eee8d5; //cream
$base3: #fff; //white for light theme
//$solar-yellow: #b58900;
//$solar-orange: #cb4b16;
//$solar-red: #dc322f;
//$solar-magenta: #d33682;
//$solar-violet: #6c71c4;
//$solar-blue: #268bd2;
//$solar-cyan: #2aa198;
//$solar-green: #859900;
/* Non highlighted code colors */
//$pre-bg: $base03;
//$pre-border: darken($base02, 5);
//$pre-color: $base1;

3
sass/custom/_styles.scss

@ -1 +1,2 @@
// Add your custom styling here. // This File is imported last, and will override other styles in the cascade
// Add styles here to make changes without digging in too much

49
sass/partials/_blog.scss

@ -1,9 +1,7 @@
article { article {
padding-top: 1em;
a { @extend .force-wrap; } a { @extend .force-wrap; }
header { header {
position: relative; position: relative;
padding-top: 2em;
padding-bottom: 1em; padding-bottom: 1em;
margin-bottom: 1em; margin-bottom: 1em;
background: $img-border bottom left repeat-x; background: $img-border bottom left repeat-x;
@ -14,7 +12,6 @@ article {
} }
p { p {
font-size: .9em; font-size: .9em;
color: $text-color-light;
margin: 0; margin: 0;
&.meta { &.meta {
@extend .sans; @extend .sans;
@ -42,38 +39,14 @@ article {
font-size: 2.0em; font-style: italic; font-size: 2.0em; font-style: italic;
line-height: 1.3em; line-height: 1.3em;
} }
img, video, .flash-video { img, video {
@extend .flex-content;
@extend .basic-alignment;
@include shadow-box; @include shadow-box;
} }
video, .flash-video { margin: 0 auto 1.5em; }
video { display: block; width: 100%; } video { display: block; width: 100%; }
.flash-video {
> div {
position: relative;
display: block;
padding-bottom: 56.25%;
padding-top: 1px;
height: 0;
overflow: hidden;
iframe, object, embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
}
> footer { > footer {
padding-bottom: 2.5em;
margin-top: 2em;
@extend .sans; @extend .sans;
p.meta { p.meta {
margin-bottom: .8em;
font-size: .85em; font-size: .85em;
clear: both;
overflow: hidden; overflow: hidden;
} }
.byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before { .byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before {
@ -93,21 +66,16 @@ article + article {
article header { background: none; padding-bottom: 0; } article header { background: none; padding-bottom: 0; }
article h1 { article h1 {
font-size: 2.2em; font-size: 2.2em;
a { color: inherit; &:hover { color: $link-color-hover; } }
} }
a[rel=full-article] { a[rel=full-article] {
background: darken($main-bg, 5);
display: inline-block; display: inline-block;
padding: .4em .8em; padding: .4em .8em;
margin-right: .5em; margin-right: .5em;
text-decoration: none; text-decoration: none;
color: mix($text-color, $text-color-light);
@extend .serif; @extend .serif;
@include transition(background-color .5s); @include transition(background-color .5s);
&:hover { &:hover {
background: $link-color-hover;
text-shadow: none; text-shadow: none;
color: $main-bg;
} }
} }
footer { footer {
@ -126,16 +94,25 @@ article + article {
text-align: center; text-align: center;
font-size: .95em; font-size: .95em;
position: relative; position: relative;
background: $img-border top left repeat-x;
padding: {top: 1.5em; bottom: 1.5em;} padding: {top: 1.5em; bottom: 1.5em;}
a { a {
text-decoration: none; text-decoration: none;
color: $text-color-light;
&.prev { position: absolute; left: 0; } &.prev { position: absolute; left: 0; }
&.next { position: absolute; right: 0; } &.next { position: absolute; right: 0; }
&:hover { color: $link-color-hover; }
&[href*=archive] { &[href*=archive] {
&:before, &:after { content: '\2014'; padding: 0 .3em; } &:before, &:after { content: '\2014'; padding: 0 .3em; }
} }
} }
} }
.footnotes {
font-size: 0.7em;
line-height: 1em;
color: $color-simple;
hr {
border: 0;
}
p {
margin-bottom: 0.3em;
}
}

22
sass/partials/_syntax.scss

@ -4,15 +4,15 @@
} }
.highlight .line-numbers, html .gist .gist-file .gist-syntax .highlight .line_numbers { .highlight .line-numbers, html .gist .gist-file .gist-syntax .highlight .line_numbers {
text-align: right; text-align: right;
font-size: 13px; font-size: 0.8em;
line-height: 1.45em; line-height: 1.45em;
@if $solarized == light { @if $solarized == light {
background: lighten($base03, 1) $noise-bg !important; background-color: lighten($base03, 1) !important;
border-right: 1px solid darken($base02, 2) !important; border-right: 1px solid darken($base02, 2) !important;
@include box-shadow(lighten($base03, 2) -1px 0 inset); @include box-shadow(lighten($base03, 2) -1px 0 inset);
text-shadow: lighten($base02, 2) 0 -1px; text-shadow: lighten($base02, 2) 0 -1px;
} @else { } @else {
background: $base02 $noise-bg !important; background-color: $base02 !important;
border-right: 1px solid darken($base03, 2) !important; border-right: 1px solid darken($base03, 2) !important;
@include box-shadow(lighten($base02, 2) -1px 0 inset); @include box-shadow(lighten($base02, 2) -1px 0 inset);
text-shadow: darken($base02, 10) 0 -1px; text-shadow: darken($base02, 10) 0 -1px;
@ -28,7 +28,7 @@ figure.code, .gist-file, pre {
} }
.gist .highlight, figure.code .highlight { .gist .highlight, figure.code .highlight {
@include selection(adjust-color($base03, $lightness: 23%, $saturation: -65%), $text-shadow: $base03 0 1px); //@include selection(adjust-color($base03, $lightness: 23%, $saturation: -65%), $text-shadow: $base03 0 1px);
} }
html .gist .gist-file { html .gist .gist-file {
margin-bottom: 1.8em; margin-bottom: 1.8em;
@ -55,11 +55,11 @@ html .gist .gist-file {
color: $base01; color: $base01;
font-size: .7em !important; font-size: .7em !important;
@if $solarized == light { @if $solarized == light {
background: lighten($base03, 2) $noise-bg; background-color: lighten($base03, 2);
border: 1px solid $pre-border !important; border: 1px solid $pre-border !important;
border-top: 1px solid lighten($base03, 2) !important; border-top: 1px solid lighten($base03, 2) !important;
} @else { } @else {
background: $base02 $noise-bg; background-color: $base02;
} }
@extend .sans; @extend .sans;
line-height: 1.5em; line-height: 1.5em;
@ -81,12 +81,12 @@ html .gist .gist-file {
} }
} }
pre { pre {
background: $pre-bg $noise-bg; background-color: $pre-bg;
@include border-radius(.4em); @include border-radius(.4em);
@extend .mono; @extend .mono;
border: 1px solid $pre-border; border: 1px solid $pre-border;
line-height: 1.45em; line-height: 1.45em;
font-size: 13px; font-size: 0.8em;
margin-bottom: 2.1em; margin-bottom: 2.1em;
padding: .8em 1em; padding: .8em 1em;
color: $pre-color; color: $pre-color;
@ -122,7 +122,7 @@ p, li {
padding: .8em; padding: .8em;
overflow-x: auto; overflow-x: auto;
line-height: 1.45em; line-height: 1.45em;
background: $base03 $noise-bg !important; background-color: $base03 !important;
color: $base1 !important; color: $base1 !important;
span { color: $base1 !important; } span { color: $base1 !important; }
span { font-style: normal !important; font-weight: normal !important; } span { font-style: normal !important; font-weight: normal !important; }
@ -234,7 +234,7 @@ figure.code {
.code-title { .code-title {
text-align: center; text-align: center;
font-size: 13px; font-size: 0.8em;
line-height: 2em; line-height: 2em;
text-shadow: #cbcccc 0 1px 0; text-shadow: #cbcccc 0 1px 0;
color: #474747; color: #474747;
@ -255,7 +255,7 @@ figure.code {
@include hover-link; @include hover-link;
color: #666 !important; color: #666 !important;
z-index: 1; z-index: 1;
font-size: 13px; font-size: 0.8em;
text-shadow: #cbcccc 0 1px 0; text-shadow: #cbcccc 0 1px 0;
padding-left: 3em; padding-left: 3em;
} }

16
sass/screen.scss

@ -1,13 +1,9 @@
@import "compass"; @import "compass";
@import "colors"; @import "custom/color";
@import "custom/colors";
@import "bootstrap"; @import "base";
@import "bootstrap-responsive"; @import "parts";
@import "flat-ui"; @import "plugins";
@import "font-awesome";
@import "octoflat-partials";
@import "solarized";
@import "syntax";
@import "quotes";
@import "custom/styles"; @import "custom/styles";

6
source/_includes/after_footer.html

@ -1,5 +1,5 @@
<script src="{{ root_url }}/javascripts/slash.js"></script>
{% include fancybox.html %} <!-- Delete or comment this line to disable Fancybox -->
{% include disqus.html %} {% include disqus.html %}
{% include facebook_like.html %} {% include google_analytics.html %}
{% include google_plus_one.html %}
{% include twitter_sharing.html %}
{% include custom/after_footer.html %} {% include custom/after_footer.html %}

43
source/_includes/archive_post.html

@ -1,23 +1,22 @@
{% capture category %}{{ post.categories | size }}{% endcapture %} {% capture date %}{{ post.date }}{% endcapture %}
<div class="row-fluid"> {% capture this_year %}{{ date | date: "%Y" }}{% endcapture %}
<div class="span1"> {% unless year == this_year %}
<h1 class="date-time"><time datetime="{{ post.date | datetime | date_to_xmlschema }}" pubdate>{{ post.date | date: "<span class='month'>%b</span> <span class='day'>%d</span><span class='year'><!--%Y--></span>"}}</time></h1> {% assign year = this_year %}
{% unless forloop.first %}
</section>
{% endunless %}
<section class="archives"><h1 class="year">{{ date | date: "%Y" }}</h1>
{% endunless %}
<article>
<h2 class="title"><a href="{{ root_url }}{{ post.url }}">{{post.title}}</a></h2>
<div class="meta">
<div class="date">{{ date | date: "%b %e" }}</div>
<div class="tags">{% include post/categories.html %}</div>
{% if site.disqus_short_name and post.comments == true and site.disqus_show_comment_count == true %}
<div class="comments"><a href="{{ root_url }}{{ post.url }}#disqus_thread">Comments</a></div>
{% endif %}
</div> </div>
<div class="span10"> </article>
<h1><a href="{{ root_url }}{{ post.url }}">{{post.title}}</a></h1> {% if forloop.last %}
</div> </section>
</div> {% endif %}
{% if category != '0' %}
<div class="row-fluid">
<div class="span1">
</div>
<div class="span10">
<footer class="archive">
<span class="categories">posted in {{ post.categories | category_links }}</span>
</footer>
</div>
</div>
{% endif %}

59
source/_includes/article.html

@ -1,39 +1,26 @@
{% unless page.no_header %}
{% if index %} {% if index %}
<div class="row-fluid"> <h2 class="title">
<div class="span2"> {% if post.external-url %}
<h1 class="date-time">{% include post/date.html %}<i class="icon-calendar-empty"></i> {{ time }}</h5> <a href="{{ post.external-url }}">
<div class="row-fluid"> {% else %}
{% if site.disqus_short_name and page.comments != false and post.comments != false and site.disqus_show_comment_count == true %} <a href="{{ root_url }}{{ post.url }}">
<a href="{% if index %}{{ site.url }}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread">Comments </a> <span class="fui-bubble-16"></span> {% endif %}
{% endif %} {% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a>
</div> </h2>
{% if post.categories %} <div class="entry-content">
<div class="row-fluid"> {{ content | excerpt }}
{% for category in post.categories %} {% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
<a href="{{ root_url }}/{{ site.category_dir }}/{{ category | split: " " | join: "-" }}/"><span class="badge">{{ category }}</span></a> {% if excerpted == 'true' %}<a href="{{ root_url }}{{ post.url }}" class="more-link">{{ site.excerpt_link }}</a>{% endif %}
{% endfor %} </div>
</div>
{% endif %}
</div>
<div class="span10">
<h1 class="link"><a href="{{ root_url }}{{ post.url }}">{{ post.title }}</a></h1>
{{ content | excerpt }}
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
{% if excerpted == 'true' %} <a href="{{ root_url }}{{ post.url }}">{{ site.excerpt_link }}</a> {% endif %}
</div>
</div>
{% else %} {% else %}
<header> <h2 class="title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h2>
<div class="jumbotron"> <div class="entry-content">{{ content }}</div>
{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}
<h5>{% include post/date.html %}<i class="icon-calendar-empty"></i> {{ time }}</h5>
</div>
</header>
<div class="row-fluid">
<div class="span12">
{{ content }}
</div>
</div>
{% endif %} {% endif %}
{% endunless %}
<div class="meta">
<div class="date">{% include post/date.html %}{{ time }}</div>
<div class="tags">{% include post/categories.html %}</div>
{% if site.disqus_short_name and site.disqus_show_comment_count == true %}
<div class="comments"><a href="{{ root_url }}{% if index %}{{ post.url }}{% endif %}#disqus_thread">Comments</a></div>
{% endif %}
</div>

28
source/_includes/asides/github.html

@ -1,30 +1,10 @@
{% if site.github_user %} {% if site.github_user %}
<section> <section>
<h1>GitHub Repos</h1> <h2>github</h2>
<ul id="gh_repos">
<li class="loading">Status updating...</li>
</ul>
{% if site.github_show_profile_link %} {% if site.github_show_profile_link %}
<a href="https://github.com/{{site.github_user}}">@{{site.github_user}}</a> on GitHub <a href="https://github.com/{{site.github_user}}">@{{site.github_user}}</a>
{% endif %} {% endif %}
<script type="text/javascript"> <ul id="gh_repos">
$(document).ready(function(){ </ul>
if (!window.jXHR){
var jxhr = document.createElement('script');
jxhr.type = 'text/javascript';
jxhr.src = '{{ root_url}}/javascripts/libs/jXHR.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(jxhr, s);
}
github.showRepos({
user: '{{site.github_user}}',
count: {{site.github_repo_count}},
skip_forks: {{site.github_skip_forks}},
target: '#gh_repos'
});
});
</script>
<script src="{{ root_url }}/javascripts/github.js" type="text/javascript"> </script>
</section> </section>
{% endif %} {% endif %}

8
source/_includes/asides/recent_posts.html

@ -1,10 +1,10 @@
<!--<section> <section>
<h1>Recent Posts</h1> <h2>recent</h2>
<ul id="recent_posts"> <ul id="recent_posts">
{% for post in site.posts limit: site.recent_posts %} {% for post in site.posts limit: site.recent_posts %}
<li class="post"> <li class="post">
<a href="{{ root_url }}{{ post.url }}">{{ post.title }}</a> <a href="{{ root_url }}{{ post.url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</section>--> </section>

3
source/_includes/custom/after_footer.html

@ -1,3 +0,0 @@
{% comment %}
Add content to be output at the bottom of each page. (You might use this for analytics scripts, for example)
{% endcomment %}

18
source/_includes/custom/footer.html

@ -1,10 +1,8 @@
<p> Copyright &copy; {{ site.time | date: "%Y" }}
Copyright &copy; {{ site.time | date: "%Y" }} - {{ site.author }} - {% if site.author %}
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span> - Theme by <a href="http://alexgaribay.com">Alex Garibay</a> Hosted by <a href="http://github.com" target="_BLANK">GitHub</a> {{ site.author }}
<br/> {% else %}
<div style="text-align: center;"> {{ site.title }}
<a href="http://planet.sofiavalley.com/" target="_BLANK"> {% endif %}
<img src="https://2.gravatar.com/avatar/1f7785f4f6ead44826cab850fa447351?d=https%3A%2F%2Fidentiscons.github.com%2F69e88b213e91b67d3cf0ea69c26e81aa.png&r=x&s=50" ALT="Planet Sofia Valley"> <br/><br/>
</a> <div class="center"><a href="http://planet.sofiavalley.com/" target="_BLANK"><img src="https://2.gravatar.com/avatar/1f7785f4f6ead44826cab850fa447351?d=https%3A%2F%2Fidentiscons.github.com%2F69e88b213e91b67d3cf0ea69c26e81aa.png&r=x&s=50"></img></a></div>
</p>
</div>

3
source/_includes/custom/head.html

@ -1,3 +0,0 @@
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">

6
source/_includes/custom/header.html

@ -1,6 +0,0 @@
<div class="jumbotron">
<div class="container">
Hi. I'm Blago.
<h3 class="tagline">This is just another personal blog</h3>
</div>
</div>

2
source/_includes/custom/navigation.html

@ -1,4 +1,4 @@
<ul class="nav"> <ul class="main">
{% for link in site.navigation %} {% for link in site.navigation %}
<li {% if page.url == link.url %}class="active"{% endif %}><a href="{{ link.url }}">{{ link.text }}</a></li> <li {% if page.url == link.url %}class="active"{% endif %}><a href="{{ link.url }}">{{ link.text }}</a></li>
{% endfor %} {% endfor %}

2
source/_includes/disqus.html

@ -14,7 +14,7 @@
{% endif %} {% endif %}
(function () { (function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script; dsq.src = '//go.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}()); }());
</script> </script>

20
source/_includes/google_analytics.html

@ -1,13 +1,13 @@
{% if site.google_analytics_tracking_id %} {% if site.google_analytics_tracking_id %}
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']); _gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']);
_gaq.push(['_trackPageview']); _gaq.push(['_trackPageview']);
(function() { (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})(); })();
</script> </script>
{% endif %} {% endif %}

47
source/_includes/head.html

@ -1,35 +1,20 @@
<!DOCTYPE html> <!DOCTYPE HTML>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]--> <html>
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}</title> <title>{% if page.title %}{{ page.title | strip_html }} - {% endif %}{{ site.title }}</title>
<meta name="author" content="{{ site.author }}"> <meta name="author" content="{{ site.author }}">
{% capture description %}{% if page.description %}{{ page.description }}{% elsif site.description %}{{ site.description }}{% endif %}{% endcapture %} {% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
<meta name="description" content="{{ description }}"> <meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}">
{% capture keywords %}{% if page.keywords %}{{ page.keywords }}{% elsif site.keywords %}{{ site.keywords }}{% endif %}{% endcapture %} {% if page.keywords %}<meta name="keywords" content="{{ page.keywords }}">{% endif %}
<meta name="keywords" content="{{ keywords }}"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- http://t.co/dKP3o1e --> <link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml">
<meta name="HandheldFriendly" content="True"> <link rel="canonical" href="{{ canonical }}">
<meta name="MobileOptimized" content="320"> <link href="{{ root_url }}/favicon.png" rel="shortcut icon">
<meta name="viewport" content="width=device-width, initial-scale=1"> <link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} <script async="true" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="canonical" href="{{ canonical }}"> {% include custom/head.html %}
<link href="{{ root_url }}/favicon.png" rel="icon">
<link href='http://fonts.googleapis.com/css?family=Quicksand:300,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="{{ site.subscribe_rss }}" rel="alternate" title="{{site.title}}" type="application/atom+xml">
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap-collapse.js"></script>
<script src="{{ root_url }}/js/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/lib/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="{{ root_url }}/js/octopress.js" type="text/javascript"></script>
{% include custom/head.html %}
{% include google_analytics.html %}
</head> </head>

58
source/_includes/header.html

@ -1 +1,59 @@
<h1><a href="{{ root_url }}/">{{ site.title }}</a></h1>
<nav id="main-nav">{% include navigation.html %}</nav>
<nav id="mobile-nav">
<div class="alignleft menu">
<a class="button">Menu</a>
<div class="container">{% include navigation.html %}</div>
</div>
<div class="alignright search">
<a class="button"></a>
<div class="container">
<form action="{{ site.simple_search }}" method="get">
<input type="text" name="q" results="0">
<input type="hidden" name="q" value="site:{{ site.url | shorthand_url }}">
</form>
</div>
</div>
</nav>
<nav id="sub-nav" class="alignright">
<div class="social">
{% if site.facebook_user %}
<a class="facebook" href="http://www.facebook.com/{{ site.facebook_user }}" title="Facebook">Facebook</a>
{% endif %}
{% if site.googleplus_user and site.googleplus_hidden == false %}
<a class="google" href="https://plus.google.com/{{ site.googleplus_user }}?rel=author" title="Google+">Google+</a>
{% endif %}
{% if site.twitter_user %}
<a class="twitter" href="http://twitter.com/{{ site.twitter_user }}" title="Twitter">Twitter</a>
{% endif %}
{% if site.github_user %}
<a class="github" href="https://github.com/{{ site.github_user }}" title="GitHub">GitHub</a>
{% endif %}
{% if site.pinboard_user %}
<a class="pinboard" href="https://pinboard.in/u:{{ site.pinboard_user }}" title="Pinboard">Pinboard</a>
{% endif %}
{% if site.coderwall_user %}
<a class="coderwall" href="https://coderwall.com/{{ site.coderwall_user }}" title="Coderwall">Coderwall</a>
{% endif %}
{% if site.linkedin_user %}
<a class="linkedin" href="http://www.linkedin.com/in/{{ site.linkedin_user }}">LinkedIn</a>
{% endif %}
{% if site.pinterest_user %}
<a class="pinterest" href="https://pinterest.com/{{ site.pinterest_user }}" title="Pinterest">Pinterest</a>
{% endif %}
{% if site.delicious_user %}
<a class="delicious" href="http://delicious.com/{{ site.delicious_user }}" title="Delicious">Delicious</a>
{% endif %}
{% if site.subscribe_rss %}
<a class="rss" href="{{ site.subscribe_rss }}" title="RSS">RSS</a>
{% endif %}
{% if site.instagram_user %}
<a class="instagram" href="http://instagram.com/{{ site.instagram_user }}" title="Instagram">Instagram</a>
{% endif %}
</div>
<form class="search" action="{{ site.simple_search }}" method="get">
<input class="alignright" type="text" name="q" results="0">
<input type="hidden" name="q" value="site:{{ site.url | shorthand_url }}">
</form>
</nav>
{% include custom/header.html %} {% include custom/header.html %}

20
source/_includes/navigation.html

@ -1,21 +1 @@
{% include custom/navigation.html %} {% include custom/navigation.html %}
<ul class="nav pull-right">
{% if site.github_user %}
<li><a href="http://github.com/{{ site.github_user }}" title="Github Profile"><i class="icon-github-sign social-navbar"></i></a></li>
{% endif %}
{% if site.linkedin_user %}
<li><a href="http://linkedin.com/in/{{ site.linkedin_user }}" title="Linkedin Profile"><i class="icon-linkedin-sign social-navbar"></i></a></li>
{% endif %}
{% if site.twitter_user %}
<li><a href="http://twitter.com/{{ site.twitter_user }}" title="Twitter Profile"><i class="icon-twitter-sign social-navbar"></i></a></li>
{% endif %}
{% if site.googleplus_user %}
<li><a href="http://plus.google.com/{{ site.googleplus_user }}" title="Google+ Profile"><i class="icon-google-plus-sign social-navbar"></i></a></li>
{% endif %}
{% if site.facebook_user %}
<li><a href="http://facebook.com/{{ site.facebook_user }}" title="Facebook Profile"><i class="icon-facebook-sign social-navbar"></i></a></li>
{% endif %}
{% if site.email %}
<li><a href="mailto:{{ site.email }}" title="Email"><i class="icon-envelope-alt social-navbar"></i></a></li>
{% endif %}
</ul>

8
source/_includes/post/categories.html

@ -1,12 +1,8 @@
{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %} {% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %}
{% unless category == '0' %} {% unless category == '0' %}
{% if post %} {% if post %}
{% for category in post.categories %} {{ post.categories | category_links }}
<a href="{{ root_url }}/{{ site.category_dir }}/{{ category | split: " " | join: "-" }}/"><span class="badge">{{ category }}</span></a>
{% endfor %}
{% else %} {% else %}
{% for category in page.categories %} {{ page.categories | category_links }}
<a href="{{ root_url }}/{{ site.category_dir }}/{{ category | split: " " | join: "-" }}/"><span class="badge">{{ category }}</span></a>
{% endfor %}
{% endif %} {% endif %}
{% endunless %} {% endunless %}

32
source/_includes/post/sharing.html

@ -1,15 +1,19 @@
<div class="sharing"> <div class="share">
<div class="addthis_toolbox addthis_default_style "> <div class="addthis_toolbox addthis_default_style ">
{% if site.facebook_like %} {% if site.facebook_like %}
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
{% endif %} {% endif %}
{% if site.twitter_tweet_button %} {% if site.twitter_tweet_button %}
<a class="addthis_button_tweet"></a> <a class="addthis_button_tweet"></a>
{% endif %} {% endif %}
{% if site.google_plus_one %} {% if site.google_plus_one %}
<a class="addthis_button_google_plusone" g:plusone:size="{{ site.google_plus_one_size }}"></a> <a class="addthis_button_google_plusone" g:plusone:size="{{ site.google_plus_one_size }}"></a>
{% endif %} {% endif %}
<a class="addthis_counter addthis_pill_style"></a> {% if site.addthis_button %}
</div> <a class="addthis_counter addthis_pill_style"></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid={{ site.addthis_profile_id }}"></script> {% endif %}
</div>
{% if site.addthis_button %}
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid={{ site.addthis_profile_id }}"></script>
{% endif %}
</div> </div>

2
source/_includes/twitter_sharing.html

@ -4,7 +4,7 @@
var twitterWidgets = document.createElement('script'); var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript'; twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true; twitterWidgets.async = true;
twitterWidgets.src = 'http://platform.twitter.com/widgets.js'; twitterWidgets.src = '//platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets); document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})(); })();
</script> </script>

21
source/_layouts/category_index.html

@ -1,24 +1,7 @@
--- ---
layout: page layout: default
footer: false
--- ---
<div id="blog-archives" class="category">
{% for post in site.categories[page.category] %} {% for post in site.categories[page.category] %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} {% include archive_post.html %}
<div class="row-fluid">
<div class="span1">
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% unless year == this_year %}
{% assign year = this_year %}
<h2>{{ year }}</h2>
{% endunless %}
</div>
<div class="span11">
<article>
{% include archive_post.html %}
</article>
</div>
</div>
{% endfor %} {% endfor %}
</div>

37
source/_layouts/default.html

@ -1,32 +1,13 @@
{% capture root_url %}{{ site.root | strip_slash }}{% endcapture %} {% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
{% include head.html %} {% include head.html %}
<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %} {% if page.sidebar == 'collapse' or site.sidebar == 'collapse' %} class="collapse-sidebar sidebar-footer" {% endif %}>
<div class="navbar navbar-inverse navbar-static-top"> <body>
<div class="navbar-inner"> <header id="header" class="inner">{% include header.html %}</header>
<div class="container"> {% unless page.banner == false %}
<a class="btn btn-navbar" data-toggle="collapse" data-target=".navbar-responsive-collapse"> {% include banner.html %}
<span class="fui-menu-24"></span> {% endunless %}
</a> <div id="content" class="inner">{{ content | expand_urls: root_url }}</div>
<div class="nav-collapse collapse navbar-responsive-collapse" style="height:0;"> <footer id="footer" class="inner">{% include footer.html %}</footer>
{% include navigation.html %} {% include after_footer.html %}
</div>
</div>
</div>
</div>
<div class="container" id="main">
<div class="span12">
<div class="row-fluid">
<div id="content">
{{ content | expand_urls: root_url }}
</div>
</div>
<div class="row-fluid">
<footer class="footer-page" role="contentinfo">
{% include footer.html %}
</footer>
</div>
</div>
</div>
{% include after_footer.html %}
</body> </body>
</html> </html>

38
source/_layouts/page.html

@ -2,34 +2,18 @@
layout: default layout: default
--- ---
<article role="article"> <article class="page">
{% if page.title %} {% if page.title %}
<header> <h1 class="title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
<div class="jumbotron"> {% endif %}
{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %} <div class="entry-content">{{ content }}</div>
</div>
{% if page.date %}<p class="meta">{% include post/date.html %}{{ time }}</p>{% endif %}
</header>
{% endif %}
{{ content }}
</article> </article>
{% unless page.sharing == false %}
{% include post/sharing.html %}
{% endunless %}
{% if site.disqus_short_name and page.comments == true %} {% if site.disqus_short_name and page.comments == true %}
<section> <section id="comment">
<h1>Comments</h1> <h1 class="title">Comments</h1>
<div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div> <div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div>
</section> </section>
{% endif %} {% endif %}
{% comment %}
Sidebars need to be fixed
{% unless page.sidebar == false %}
<aside class="sidebar">
{% if site.page_asides.size %}
{% include_array page_asides %}
{% else %}
{% include_array default_asides %}
{% endif %}
</aside>
{% endunless %}
{% endcomment %}

67
source/_layouts/post.html

@ -3,66 +3,13 @@ layout: default
single: true single: true
--- ---
<div> <article class="post">{% include article.html %}</article>
<article class="hentry" role="article"> {% unless page.sharing == false %}
{% include article.html %} {% include post/sharing.html %}
<footer> {% endunless %}
<hr>
{% if page.category or page.categories or page.sharing != false %}
<div class="row-fluid">
{% if page.category or page.categories %}
<div class="span6">
<p class="meta">
{% if updated %}{{ updated }}</br>{% else %}{% endif %}
{% include post/categories.html %}
</p>
</div>
{% unless page.sharing == false %}
<div class="span6 social-sharing">
{% include post/sharing.html %}
</div>
{% endunless %}
{% else %}
{% unless page.sharing == false %}
<div class="span12">
{% include post/sharing.html %}
</div>
{% endunless %}
{% endif %}
</div>
{% endif %}
<div class="row-fluid">
<div class="span12">
<p class="meta">
{% if page.previous.url %}
<a class="basic-alignment left" href="{{page.previous.url}}" title="Previous Post: {{page.previous.title}}">&laquo; {{page.previous.title}}</a>
{% endif %}
{% if page.next.url %}
<a class="basic-alignment right" href="{{page.next.url}}" title="Next Post: {{page.next.title}}">{{page.next.title}} &raquo;</a>
{% endif %}
</p>
</div>
</div>
</footer>
</article>
{% if site.disqus_short_name and page.comments == true %} {% if site.disqus_short_name and page.comments == true %}
<section> <section id="comment">
<h1>Comments</h1> <h2 class="title">Comments</h2>
<div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div> <div id="disqus_thread" aria-live="polite">{% include post/disqus_thread.html %}</div>
</section> </section>
{% endif %} {% endif %}
</div>
{% comment %}
Sidebars need to be fixed
{% unless page.sidebar == false %}
<aside class="sidebar">
{% if site.page_asides.size %}
{% include_array page_asides %}
{% else %}
{% include_array default_asides %}
{% endif %}
</aside>
{% endunless %}
{% endcomment %}

27
source/blog/archives/index.html

@ -1,29 +1,8 @@
--- ---
layout: page layout: default
title: Blog Archive title: Blog Archives
footer: false
--- ---
<div clas id="blog-archives">
{% for post in site.posts reverse %} {% for post in site.posts reverse %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} {% include archive_post.html %}
<div class="row-fluid">
<div class="span1">
{% unless year == this_year %}
{% assign year = this_year %}
<h1>{{ year }}</h1>
{% endunless %}
</div>
{% if post == site.posts.first %}
<div class="span11">
{% else %}
<div class="span11 border-top">
{% endif %}
<article>
{% include archive_post.html %}
</article>
</div>
</div>
{% endfor %} {% endfor %}
</div>

32
source/index.html

@ -1,26 +1,18 @@
--- ---
layout: default layout: default
--- ---
{% include header.html %}
<div class="blog-index">
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article>
{% include article.html %}
</article>
{% unless post == paginator.posts.last %}
<hr>
{% endunless %}
{% endfor %}
<div class="pagination">
{% if paginator.next_page %}
<a class="prev" href="{{paginator.next_page}}">&larr; Older</a>
{% endif %}
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article class="post">{% include article.html %}</article>
{% endfor %}
<nav id="pagenavi">
{% if paginator.previous_page %} {% if paginator.previous_page %}
<a class="next" href="{{paginator.previous_page}}">Newer &rarr;</a> <a href="{{paginator.previous_page}}" class="prev">Prev</a>
{% endif %} {% endif %}
</div> {% if paginator.next_page %}
</div> <a href="{{paginator.next_page}}" class="next">Next</a>
{% endif %}
<div class="center"><a href="{{ root_url }}/blog/archives">Blog Archives</a></div>
</nav>

3179
source/javascripts/libs/jquery.min.js

File diff suppressed because one or more lines are too long

104
source/javascripts/octopress.js

@ -1,42 +1,3 @@
function getNav() {
var mainNav = $('ul.main-navigation, ul[role=main-navigation]').before('<fieldset class="mobile-nav">')
var mobileNav = $('fieldset.mobile-nav').append('<select>');
mobileNav.find('select').append('<option value="">Navigate&hellip;</option>');
var addOption = function(i, option) {
mobileNav.find('select').append('<option value="' + this.href + '">&raquo; ' + $(this).text() + '</option>');
}
mainNav.find('a').each(addOption);
$('ul.subscription a').each(addOption);
mobileNav.find('select').bind('change', function(event) {
if (event.target.value) { window.location.href = event.target.value; }
});
}
function addSidebarToggler() {
if(!$('body').hasClass('sidebar-footer')) {
$('#content').append('<span class="toggle-sidebar"></span>');
$('.toggle-sidebar').bind('click', function(e) {
e.preventDefault();
if ($('body').hasClass('collapse-sidebar')) {
$('body').removeClass('collapse-sidebar');
} else {
$('body').addClass('collapse-sidebar');
}
});
}
var sections = $('aside.sidebar > section');
if (sections.length > 1) {
sections.each(function(index, section){
if ((sections.length >= 3) && index % 3 === 0) {
$(section).addClass("first");
}
var count = ((index +1) % 2) ? "odd" : "even";
$(section).addClass(count);
});
}
if (sections.length >= 3){ $('aside.sidebar').addClass('thirds'); }
}
function testFeatures() { function testFeatures() {
var features = ['maskImage']; var features = ['maskImage'];
$(features).map(function(i, feature) { $(features).map(function(i, feature) {
@ -69,53 +30,26 @@ function addCodeLineNumbers() {
}); });
} }
function flashVideoFallback(){ disqus_init = false;
var flashplayerlocation = "/assets/jwplayer/player.swf",
flashplayerskin = "/assets/jwplayer/glow/glow.xml";
$('video').each(function(i, video){
video = $(video);
if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){
video.children('source[src$=mp4]').first().map(i, function(source){
var src = $(source).attr('src'),
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" }
);
});
video.remove();
}
});
}
function wrapFlashVideos() { function toggleDisqus() {
$('object').each(function(i, object) { var dom = document.getElementById('disqus_thread');
if( $(object).find('param[name=movie]').length ){ if (dom.className.indexOf('hide') != -1) {
$(object).wrap('<div class="flash-video">') dom.className = dom.className.replace(/\bhide\b/,'');
if (!disqus_init) {
loadDisqus();
disqus_init = true;
// hacking for disqus bad height
} }
}); } else {
$('iframe[src*=vimeo],iframe[src*=youtube]').wrap('<div class="flash-video">') dom.className += ' hide';
}
function renderDeliciousLinks(items) {
var output = "<ul>";
for (var i=0,l=items.length; i<l; i++) {
output += '<li><a href="' + items[i].u + '" title="Tags: ' + (items[i].t == "" ? "" : items[i].t.join(', ')) + '">' + items[i].d + '</a></li>';
} }
output += "</ul>"; return false;
$('#delicious').html(output);
} }
$('document').ready(function() { $('document').ready(function() {
testFeatures(); testFeatures();
wrapFlashVideos();
flashVideoFallback();
addCodeLineNumbers(); addCodeLineNumbers();
getNav();
addSidebarToggler();
}); });
// iOS scaling bug fix // iOS scaling bug fix
@ -139,17 +73,3 @@ $('document').ready(function() {
} }
}(document)); }(document));
/*! SWFObject v2.2 modified by Brandon Mathis to contain only what is necessary to dynamically embed flash objects
* Uncompressed source in javascripts/libs/swfobject-dynamic.js
* <http://code.google.com/p/swfobject/>
released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){function s(a,b,d){var q,k=n(d);if(g.wk&&g.wk<312)return q;if(k){if(typeof a.id==l)a.id=d;if(g.ie&&g.win){var e="",c;for(c in a)if(a[c]!=Object.prototype[c])c.toLowerCase()=="data"?b.movie=a[c]:c.toLowerCase()=="styleclass"?e+=' class="'+a[c]+'"':c.toLowerCase()!="classid"&&(e+=" "+c+'="'+a[c]+'"');c="";for(var f in b)b[f]!=Object.prototype[f]&&(c+='<param name="'+f+'" value="'+b[f]+'" />');k.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+e+">"+c+
"</object>";q=n(a.id)}else{f=i.createElement(o);f.setAttribute("type",m);for(var h in a)a[h]!=Object.prototype[h]&&(h.toLowerCase()=="styleclass"?f.setAttribute("class",a[h]):h.toLowerCase()!="classid"&&f.setAttribute(h,a[h]));for(e in b)b[e]!=Object.prototype[e]&&e.toLowerCase()!="movie"&&(a=f,c=e,h=b[e],d=i.createElement("param"),d.setAttribute("name",c),d.setAttribute("value",h),a.appendChild(d));k.parentNode.replaceChild(f,k);q=f}}return q}function n(a){var b=null;try{b=i.getElementById(a)}catch(d){}return b}
function t(a){var b=g.pv,a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1}function u(a){return/[\\\"<>\.;]/.exec(a)!=null&&typeof encodeURIComponent!=l?encodeURIComponent(a):a}var l="undefined",o="object",m="application/x-shockwave-flash",v=window,i=document,j=navigator,g=function(){var a=typeof i.getElementById!=l&&typeof i.getElementsByTagName!=l&&typeof i.createElement!=l,
b=j.userAgent.toLowerCase(),d=j.platform.toLowerCase(),g=d?/win/.test(d):/win/.test(b),d=d?/mac/.test(d):/mac/.test(b),b=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,k=!+"\u000b1",e=[0,0,0],c=null;if(typeof j.plugins!=l&&typeof j.plugins["Shockwave Flash"]==o){if((c=j.plugins["Shockwave Flash"].description)&&!(typeof j.mimeTypes!=l&&j.mimeTypes[m]&&!j.mimeTypes[m].enabledPlugin))k=!1,c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),e[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),
10),e[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),e[2]=/[a-zA-Z]/.test(c)?parseInt(c.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof v.ActiveXObject!=l)try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(f&&(c=f.GetVariable("$version")))k=!0,c=c.split(" ")[1].split(","),e=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]}catch(h){}return{w3:a,pv:e,wk:b,ie:k,win:g,mac:d}}();return{embedSWF:function(a,b,d,i,k,e,c,f,h){var j={success:!1,id:b};if(g.w3&&!(g.wk&&g.wk<312)&&
a&&b&&d&&i&&k){d+="";i+="";var p={};if(f&&typeof f===o)for(var m in f)p[m]=f[m];p.data=a;p.width=d;p.height=i;a={};if(c&&typeof c===o)for(var n in c)a[n]=c[n];if(e&&typeof e===o)for(var r in e)typeof a.flashvars!=l?a.flashvars+="&"+r+"="+e[r]:a.flashvars=r+"="+e[r];if(t(k))b=s(p,a,b),j.success=!0,j.ref=b}h&&h(j)},ua:g,getFlashPlayerVersion:function(){return{major:g.pv[0],minor:g.pv[1],release:g.pv[2]}},hasFlashPlayerVersion:t,createSWF:function(a,b,d){if(g.w3)return s(a,b,d)},getQueryParamValue:function(a){var b=
i.location.search||i.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(a==null)return u(b);for(var b=b.split("&"),d=0;d<b.length;d++)if(b[d].substring(0,b[d].indexOf("="))==a)return u(b[d].substring(b[d].indexOf("=")+1))}return""}}}();

152
source/javascripts/twitter.js

@ -1,78 +1,92 @@
// JSON-P Twitter fetcher for Octopress (function($){
// (c) Brandon Mathis // MIT License $.fn.getTwitterFeed = function(userid, count, reply){
var banner = $(this),
feed = banner.find('.feed'),
interval = 10000,
speed = 500;
/* Sky Slavin, Ludopoli. MIT license. * based on JavaScript Pretty Date * Copyright (c) 2008 John Resig (jquery.com) * Licensed under the MIT license. */ var linkify = function(text){
function prettyDate(time) { text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>').replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>').replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>');
if (navigator.appName === 'Microsoft Internet Explorer') {
return "<span>&infin;</span>"; // because IE date parsing isn't fun.
}
var say = {
just_now: " now",
minute_ago: "1m",
minutes_ago: "m",
hour_ago: "1h",
hours_ago: "h",
yesterday: "1d",
days_ago: "d",
last_week: "1w",
weeks_ago: "w"
};
var current_date = new Date(), return text;
current_date_time = current_date.getTime(), }
current_date_full = current_date_time + (1 * 60000),
date = new Date(time),
diff = ((current_date_full - date.getTime()) / 1000),
day_diff = Math.floor(diff / 86400);
if (isNaN(day_diff) || day_diff < 0) { return "<span>&infin;</span>"; } var relativeDate = function(date){
if (navigator.appName === 'Microsoft Internet Explorer') return '';
return day_diff === 0 && ( var unit = {
diff < 60 && say.just_now || now: 'Now',
diff < 120 && say.minute_ago || minute: '1 min',
diff < 3600 && Math.floor(diff / 60) + say.minutes_ago || minutes: ' mins',
diff < 7200 && say.hour_ago || hour: '1 hr',
diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) || hours: ' hrs',
day_diff === 1 && say.yesterday || day: 'Yesterday',
day_diff < 7 && day_diff + say.days_ago || days: ' days',
day_diff === 7 && say.last_week || week: '1 week',
day_diff > 7 && Math.ceil(day_diff / 7) + say.weeks_ago; weeks: ' weeks'
} };
function linkifyTweet(text, url) { var current = new Date(),
// Linkify urls, usernames, hashtags tweet = new Date(date),
text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>') diff = (((current.getTime() + (1 * 60000)) - tweet.getTime()) / 1000),
.replace(/(^|\W)@(\w+)/g, '$1<a href="https://twitter.com/$2">@$2</a>') day_diff = Math.floor(diff / 86400);
.replace(/(^|\W)#(\w+)/g, '$1<a href="https://search.twitter.com/search?q=%23$2">#$2</a>');
// Use twitter's api to replace t.co shortened urls with expanded ones. if (day_diff == 0){
for (var u in url) { if (diff < 60) return unit.now;
if(url[u].expanded_url != null){ else if (diff < 120) return unit.minute;
var shortUrl = new RegExp(url[u].url, 'g'); else if (diff < 3600) return Math.floor(diff / 60) + unit.minutes;
text = text.replace(shortUrl, url[u].expanded_url); else if (diff < 7200) return unit.hour;
var shortUrl = new RegExp(">"+(url[u].url.replace(/https?:\/\//, '')), 'g'); else if (diff < 86400) return Math.floor(diff / 3600) + unit.hours;
text = text.replace(shortUrl, ">"+url[u].display_url); else return '';
} } else if (day_diff == 1) {
} return unit.day;
return text } else if (day_diff < 7) {
} return day_diff + unit.days;
} else if (day_diff == 7) {
return unit.week;
} else if (day_diff > 7) {
return Math.ceil(day_diff / 7) + unit.weeks;
} else {
return '';
}
}
function showTwitterFeed(tweets, twitter_user) { if ($(window).width() > 600){
var timeline = document.getElementById('tweets'), var url = 'https://api.twitter.com/1/statuses/user_timeline/'+userid+'.json?count='+count+'&exclude_replies='+(reply ? '0' : '1')+'&trim_user=true&callback=?';
content = ''; banner.show();
$.getJSON(url, function(json){
var length = json.length,
fragment = document.createDocumentFragment(),
counts = 0,
timeout;
for (var t in tweets) { for (var i=0; i<length; i++){
content += '<li>'+'<p>'+'<a href="https://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'), tweets[t].entities.urls)+'</p>'+'</li>'; var item = document.createElement('li');
} item.innerHTML = linkify(json[i].text) + '<small>'+relativeDate(json[i].created_at)+'</small>';
timeline.innerHTML = content; fragment.appendChild(item);
} }
function getTwitterFeed(user, count, replies) { var play = function(){
count = parseInt(count, 10); timeout = setTimeout(function(){
$.ajax({ feed.animate({top: '-='+30}, speed, function(){
url: "https://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" $(this).append($(this).children().eq(counts).clone());
, type: 'jsonp' counts++;
, error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } play();
, success: function(data) { showTwitterFeed(data.slice(0, count), user); } });
}) }, interval);
} }
var pause = function(){
clearTimeout(timeout);
}
banner.on('mouseenter', pause).on('mouseleave', play)
.children('.loading').hide().end()
.children('.container').show()
.children('.feed').append(fragment);
play();
});
}
};
})(jQuery);
Loading…
Cancel
Save