Skip to content

Instantly share code, notes, and snippets.

@kuatsure
Created August 19, 2013 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuatsure/6271395 to your computer and use it in GitHub Desktop.
Save kuatsure/6271395 to your computer and use it in GitHub Desktop.
Set up a current-item navigation class based on page.tags in jekyll
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<title>{{ page.title }} - {{ site.name }}</title>
<meta charset='utf-8'>
<link rel="stylesheet" href="/_/css/screen.css" />
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="page">
<div id="root">
<header class="header">
<div class="crown">
<div class="logo">
<a href="/"><img alt="Logo" src="../_/img/dot.png" width="300" height="113" /></a>
</div>
<nav class="navigation">
<ul class="nav nav--block">
<li class="home"><a href="/"{% if page.tags == "root" %} class="current-item"{% endif %}>Home</a></li>
<li class="support"><a href="/support"{% if page.tags == "support" %} class="current-item"{% endif %}>Support</a></li>
<li class="contact-us"><a href="/contact"{% if page.tags == "contact" %} class="current-item"{% endif %}>Contact</a></li>
<li class="blog"><a href='/blog'>blog</a></li>
</ul>
</nav>
</div>
</header>
{{ content }}
<div id="root-footer"></div>
</div>
</body>
</html>
---
layout: default
title: Four o' Four
tags: root
---
<div class="main four-o-four">
<section class="screenshot-of">
<img src="../_/img/icon-about-filler.png" width="330" height="330" alt="Logo" />
</section>
<section class="copy-of">
<h3 class="title">Whoops.</h3>
<p>That's not supposed to happen.</p>
</section>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment