-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathpost.html
72 lines (66 loc) · 2.4 KB
/
post.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
71
72
---
layout: default
---
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<span class="time">{{ page.date | date_to_string }}</span> - by {{ page.author }}
<div class="content">
{% if page.image %}
<p><img src="{{ page.image }}" alt="header image" id="header-image"></p>
{% endif %}
<div class="post">{{ content }}</div>
<hr>
<a href="/">Return to Home</a>
</div>
{% assign hasSimilar = '' %}
{% for post in site.posts %}
{% assign postHasSimilar = false %}
{% for tag in post.categories %}
{% for thisTag in page.categories %}
{% if postHasSimilar == false and hasSimilar.size < 6 and post != page and tag == thisTag %}
{% if hasSimilar.size == 0 %}
<div class="panel-body">
<h4>Related Posts</h4>
<ul>
{% endif %}
<li class="relatedPost">
<a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a>
{% if post.categories %}
(Categories: {% for category in post.categories %}<a href="/category/{{ category }}">{{ category }}</a>{% if forloop.last == false %}, {% endif %}{% endfor %})
{% endif %}
</li>
{% capture hasSimilar %}{{ hasSimilar }}*{% endcapture %}
{% assign postHasSimilar = true %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% if hasSimilar.size > 0 %}
</ul>
</div>
{% endif %}
<div class="PageNavigation">
{% if page.previous.url %}
<a class="prev" href="{{ page.previous.url }}">« {{ page.previous.title }}</a>
{% endif %}
{% if page.next.url %}
<a class="next" href="{{ page.next.url }}">{{ page.next.title }} »</a>
{% endif %}
</div>
<div class="disqus-comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
/* <![CDATA[ */
var disqus_shortname = "{{ site.disqus_shortname }}";
var disqus_identifier = "{{ site.url }}_{{ page.title }}";
var disqus_title = "{{ page.title }}";
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
/* ]]> */
</script>
</div>