-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
59 lines (49 loc) · 1.35 KB
/
index.html
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
57
58
59
---
layout: default
---
<div class="home">
<div class="container">
{% for post in site.posts %}
<article class="post post--list">
<time
class="post__date"
datetime="{{ post.date | date_to_xmlschema }}"
itemprop="datePublished"
>
{{ post.date | date: "%b %-d, %Y" }}
</time>
<h2>
<a
class="post__title post__title--list _unborder"
href="{{ post.url | prepend: site.baseurl }}"
tabindex="-1"
>
{{ post.title }}
</a>
</h2>
{{ post.excerpt | strip_html | truncate: 300 }}
{% if post.excerpt | size > 300 %}
<a
class="_unborder js-read-more"
href="{{ post.url | prepend: site.baseurl }}"
>
<strong>Read more →</strong>
</a>
{% endif %}
</article>
{% endfor %}
</div>
</div>
<script>
(function (d) {
var buttons = [].slice.call(d.querySelectorAll('.js-read-more'));
function addFocusListener (button) {
function toggleFocused () {
button.parentNode.classList.toggle('post--list--focused');
}
button.addEventListener('focus', toggleFocused);
button.addEventListener('blur', toggleFocused);
}
buttons.forEach(addFocusListener);
})(document);
</script>