Skip to content

Instantly share code, notes, and snippets.

View micahgodbolt's full-sized avatar

Micah Godbolt micahgodbolt

View GitHub Profile
@micahgodbolt
micahgodbolt / hero.twig
Last active November 11, 2016 19:08 — forked from kevinmpowell/hero.twig
Nunjucks component macro - NOTE: Had to use .twig file extension since Github Gists don't support .njk :(
<div class="hero" style="background-image:url({{ background_image OR "http://placehold.it/1000x400" }})">
<h1 class="hero__title">{{ title OR "We Are Awesome" }}</h1>
{% block body %}
{% endblock %}
{% block footer %}
<a class="hero__cta button button--primary" href="{{ cta_href OR "/some/awesome-link.html" }}>{{ cta_text OR "Find Out Why!" }}</a>
{% endblock %}
</div>
$(document).ready(function() {
// Make tabs work
$('.tabs-wrapper .tab-option').hide();
$('.tabs-wrapper .tab-option:first').show();
$('.tabs-wrapper li:first').addClass('active');
$('.tabs-wrapper .tabs li a').click(function(){
$(this).parent().siblings().removeClass('active');