forked from nodegit/nodegit.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhead.html
More file actions
56 lines (48 loc) · 2.09 KB
/
head.html
File metadata and controls
56 lines (48 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/js/sticky.js"></script>
<script>
var headlines = [];
$(function() {
$(".outline").stick_in_parent({offset_top:30});
$('a[name]').each(function() {
headlines.push({el: $(this), top:$(this).offset().top});
});
var selectHeadline = function() {
if (headlines.length) {
var top = $(window).scrollTop();
var headline = headlines[0].el;
for(var i=0;i<headlines.length;i++) {
if (headlines[i].top <= top + 30) {
headline = headlines[i].el;
}
}
var el = $("a[href='#" + headline.attr('name') + "']");
if (!el.hasClass('selected')) {
$('a[href^=#].selected').removeClass('selected');
el.addClass('selected');
}
}
}
$(window).on('scroll', selectHeadline);
selectHeadline();
});
$(document).on('click', 'a[href^=#]', function(e) {
var tag = $(e.currentTarget).attr('href').replace(/^#/, '');
var el = $("a[name='" + tag + "']");
$('html,body').animate({scrollTop: el.offset().top-30});
return false;
});
$(document).on('click', '.hamburger', function() {
$('.hamburger, nav').toggleClass('open');
})
</script>
</head>