-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathindex.html
70 lines (61 loc) · 1.92 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
60
61
62
63
64
65
66
67
68
69
70
---
layout: default
title: iwanttolearnruby
---
<ul class='links'>
<li><a href="#all" id="post" class='current'>all</a></li>
{% for category in site.categories %}
<li><a href="#{{ category | first }}" id="{{ category | first }}">{{ category | first }}</a></li>
{% endfor %}
</ul>
<div class="posts">
{% for post in site.posts %}
<div class='post {{ post.categories | join ' ' }}'>
<a href="{{ post.link }}">
{% if post.image %}
{% if post.image contains 'http://' or post.image contains 'https://' %}
<img src="{{ post.image }}" width="300" height="180" />
{% else %}
<img src="images/{{ post.image }}" width="300" height="180" />
{% endif %}
{% else %}
<img src="images/default.png" width="300" height="180" />
{% endif %}
</a>
<h3>
<a href="{{ post.link }}">{{ post.title }}</a>
<span class="link"><a href="{{ post.link }}">{{ post.link }}</a></span>
</h3>
<p>{{ post.content }}</p>
<ul>
{% for price in post.price %}
<li class='price'>{{ price }}</li>
{% endfor %}
{% for category in post.categories %}
<li class='category'>{{ category }}</li>
{% endfor %}
{% for level in post.level %}
<li class='level'>{{ level }}</li>
{% endfor %}
{% for instruction in post.instruction %}
<li class='instruction'>{{ instruction }}</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
<script type="text/javascript">
$(function(){
$(".links li").tsort();
$(".post").tsort();
$(".links a").click(function(e){
$('.links a').removeClass('current');
filter_class = $(this).attr('id');
$(this).addClass('current');
$('.post').hide();
$("." + filter_class).show();
$('html, body').animate({scrollTop:0}, 'slow');
return false; // remove this later so people can actually link to sections
});
});
</script>