Skip to content

Commit

Permalink
dynamically build navigation for the win
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunicorn committed Aug 10, 2012
1 parent db42925 commit dd885cc
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions _layouts/simple.html
Expand Up @@ -52,6 +52,13 @@ <h1 class="workshop_title">
{{page.title}}
</h1>


{% if site.no_nav != false %}
<nav>
<ul class="nav_list">
</ul>
</nav>
{% endif %}
</div>
</header>

Expand All @@ -71,8 +78,42 @@ <h1 class="workshop_title">
</p>

</div>
</footer>

</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>

<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]-->

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33344154-1']);
_gaq.push(['_trackPageview']);

(function() {
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';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
<script>
$(function() {
var listing = $('nav ul');
$("h2").each(function(){
var $this = $(this);
var id = $this.attr("id");
if (id) {
listing.append($('<li></li>').html($('<a></a>').attr("href",
"#" + id).html($this.html())));
}

});
});
</script>
</body>
</html>

0 comments on commit dd885cc

Please sign in to comment.