Permalink
Browse files

Added dynamic pulling of GitHub projects via JS.

  • Loading branch information...
1 parent 13109e6 commit ed6835dd2fd56acdba2de97ddbf2776cdb0af546 Michael Bleigh committed Feb 10, 2009
Showing with 155 additions and 9 deletions.
  1. +5 −1 _layouts/master.html
  2. +3 −0 _layouts/post.html
  3. +33 −5 index.html
  4. +3 −0 javascripts/jquery.github.js
  5. +19 −0 javascripts/jquery.js
  6. +24 −3 open-source.html
  7. +68 −0 stylesheets/master.css
View
@@ -6,6 +6,8 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Mister Bleigh - {{ page.title }}</title>
<link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8"/>
+ <script src="/javascripts/jquery.js" type="text/javascript" charset="utf-8"></script>
+ <script src="/javascripts/jquery.github.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id='wrapper'>
@@ -19,16 +21,18 @@
<li><a href='/blog.html'>Blog</a></li>
<li><a href='/about.html'>About</a></li>
<li><a href='/open-source.html'>Open Source</a></li>
+ <li><a href='http://github.com/mbleigh' target='_blank' rel='me'>GitHub</a></li>
<li><a href='http://www.linkedin.com/in/mbleigh' target='_blank' rel='me'>LinkedIn</a></li>
<li><a href='http://twitter.com/mbleigh' target='_blank' rel='me'>Twitter</a></li>
</ul>
</div>
<div id='content'>
{{ content }}
+ <div class='clearfix'></div>
</div>
</div>
<div id='footer'>
- Copyright &copy; 2009 Michael Bleigh. Some rights reserved.
+ Copyright &copy; 2009 Michael Bleigh. Some rights reserved. Hosted by <a href='http://github.com/mbleigh/mbleigh.github.com/' target='_blank'>GitHub</a> and powered by <a href='http://github.com/mojombo/jekyll'>Jekyll</a>.
</div>
<script type="text/javascript">
//<![CDATA[
View
@@ -20,4 +20,7 @@
</table>
</div>
+<script type="text/javascript" charset="utf-8">
+ var disqus_url = "http://www.mbleigh.com/{{page.url}}";
+</script>
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/misterbleigh/embed.js"></script><noscript><a href="http://misterbleigh.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
View
@@ -3,9 +3,37 @@
title: Michael Bleigh on the Web
---
-<div id='home_left'>
- <h2>Blog Posts</h2>
+<div class='home_box' id='home_left'>
+ <h2>Latest Blog Post (<a href='/blog.html'>More</a>)</h2>
+
+ <div class='post'>
+ <h1><a href='{{site.posts.first.url}}'>{{site.posts.first.title}}</a></h1>
+ <div class='body'>{{ site.posts.first.content }}</div>
+ <a href='{{site.posts.first.url}}#disqus_thread'>Comments</a>
+ </div>
</div>
-<div id='home_right'>
- <h2>Open Source</h2>
-</div>
+<div class='home_box' id='home_right'>
+ <h2>Open Source (<a href='/open-source.html'>More</a>)</h2>
+ <div id='github-projects'>
+ <div class="repo"> <h3><a href="http://github.com/mbleigh/acts-as-taggable-on">acts-as-taggable-on</a></h3> <span class="desc">A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/subdomain-fu">subdomain-fu</a></h3> <span class="desc">A new plugin approach to attempting to solve the usage of subdomains in linking and routing in Rails projects.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/seed-fu">seed-fu</a></h3> <span class="desc">Advanced seed data handling for Rails, combining the best practices of several methods together.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/uberkit">uberkit</a></h3> <span class="desc">The UberKit is a Rails plugin with a set of UI tools to ease common development.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/mash">mash</a></h3> <span class="desc">Mash is a Hash with the ability to read, write, and test for the presence of arbitrary attributes using method calls.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/fetches">fetches</a></h3> <span class="desc">A Rails plugin to simplify the fetching and memoization of records for parameter-based finds.</span></div>
+ </div>
+</div>
+
+<script type="text/javascript" charset="utf-8">
+ $.githubUser('mbleigh', function(data) {
+ $('#github-projects').html('');
+
+ var repos = data.user.repositories;
+ repos.sort(function(a,b) {
+ return b.watchers - a.watchers;
+ });
+
+ $(repos.slice(0,6)).each(function() {
+ $('#github-projects').append("\
+<div class='repo'>\
+ <h3><a href='" + this.url + "'>" + this.name + "</a></h3>\
+ <span class='desc'>"+this.description+"</span>\
+</div>");
+ });
+ });
+</script>
@@ -0,0 +1,3 @@
+jQuery.githubUser = function(username, callback) {
+ jQuery.getJSON("http://github.com/api/v1/json/" + username + "?callback=?", callback);
+}
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -5,6 +5,27 @@
<h2>Open-Source</h2>
-<ul id='open-source-projects'>
-
-</ul>
+<p>I have a number of open-source projects hosted on <a href='http://github.com/mbleigh' rel='me' target='_blank'>GitHub</a>. The list below is dynamically populated from all of my projects with the most popular ones appearing first.</p>
+
+<div id='github-projects' class='big'>
+ <div class="repo"> <h3><a href="http://github.com/mbleigh/acts-as-taggable-on">acts-as-taggable-on</a></h3> <span class="desc">A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/subdomain-fu">subdomain-fu</a></h3> <span class="desc">A new plugin approach to attempting to solve the usage of subdomains in linking and routing in Rails projects.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/seed-fu">seed-fu</a></h3> <span class="desc">Advanced seed data handling for Rails, combining the best practices of several methods together.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/uberkit">uberkit</a></h3> <span class="desc">The UberKit is a Rails plugin with a set of UI tools to ease common development.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/mash">mash</a></h3> <span class="desc">Mash is a Hash with the ability to read, write, and test for the presence of arbitrary attributes using method calls.</span></div><div class="repo"> <h3><a href="http://github.com/mbleigh/fetches">fetches</a></h3> <span class="desc">A Rails plugin to simplify the fetching and memoization of records for parameter-based finds.</span></div>
+</div>
+
+<script type="text/javascript" charset="utf-8">
+ $.githubUser('mbleigh', function(data) {
+ $('#github-projects').html('');
+
+ var repos = data.user.repositories;
+ repos.sort(function(a,b) {
+ return b.watchers - a.watchers;
+ });
+
+ $(repos).each(function() {
+ $('#github-projects').append("\
+<div class='repo'>\
+ <h3><a href='" + this.url + "'>" + this.name + "</a></h3>\
+ <span class='desc'>"+this.description+"</span>\
+</div>");
+ });
+ });
+</script>
View
@@ -106,6 +106,10 @@ div.post {
margin-bottom: 2em;
}
+.post h1 {
+ margin-top: 0.2em;
+}
+
.post h1 a {
text-decoration: none;
clear: left;
@@ -163,4 +167,68 @@ div.related {
font-size: 0.9em;
padding: 0.5em;
text-align: center;
+}
+
+.home_box {
+ float: left;
+}
+
+#content .home_box h2 {
+ background: #484;
+ padding: 0.3em 0.5em;
+ border-bottom: 3px solid #262;
+ margin-bottom: 0em;
+ color: white;
+}
+
+.home_box h2 a {
+ color: white;
+ margin: 0 0.2em;
+}
+
+#home_left {
+ width: 29em;
+}
+
+#home_right {
+ width: 16em;
+ margin-left: 1em;
+}
+
+.clearfix { clear: both;}
+
+#footer a {
+ color: #ecb;
+ font-weight: normal;
+}
+
+.home_box .post h1 a {
+ font-size: 0.7em;
+}
+
+.repo {
+ background: #eee;
+ padding: 0.7em 1em;
+ font-size: 0.8em;
+ margin: 1em 0;
+ -moz-border-radius: 0.5em;
+ -webkit-border-radius: 0.5em;
+ border-radius: 0.5em;
+}
+.repo h3 {
+ margin: 0 0 0.3em 0;
+}
+.repo h3 a {
+ font-weight: bold;
+ color: black;
+ letter-spacing: 0;
+}
+
+#github-projects.big .repo {
+ float: left;
+ width: 15.5em;
+ margin: 0.8em 0.7em;
+ display: inline-block;
+ float: none;
+ vertical-align: top;
}

0 comments on commit ed6835d

Please sign in to comment.