Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (43 sloc) 1.96 KB
---
layout: default
---
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
<p class="post-meta">
<time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time> &#8212;
<span data-format-number>{{ page.content | number_of_words }}</span> words
{% if page.author %} • <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}
</p>
</header>
<script src="assets/global/anchor.min.js"></script>
<script>
$(function() {
// if a p only has an img inside of it, urlify the alt text
// of the img and set that as the p's id so anchors can use it
$(".post-content > p > img").each(function(idx, el) {
var $el = $(el);
var idText = anchors.urlify("img-" + $el.attr("alt"));
$el.parent().attr("id", idText);
});
// if a table has the "alt" property, use it to set the table's
// id otherwise just use the index of that table within .post-content
$(".post-content > table").each(function(idx, el) {
var $el = $(el);
var uniqueTextForTable = $el.attr("alt") ? $el.attr("alt") : idx;
var idText = anchors.urlify("table-" + uniqueTextForTable);
$el.attr("id", idText);
});
anchors.options.visible = 'always';
anchors.add('.post-content > h1, h2, h3, h4, h5, h6');
anchors.options.icon = '';
anchors.options.placement = 'left';
anchors.options.visible = 'hover';
anchors.add('.post-content > p');
anchors.add('.post-content > table');
});
</script>
<div class="post-content" itemprop="articleBody">
{{ content }}
</div>
</article>