Created
August 19, 2013 16:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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