summaryrefslogtreecommitdiff
path: root/_layouts/post.html
blob: ed045ecc72f0a7f6805bcf5d2c739b0538f09246 (plain)
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: framework
banner:
banner_html: post-header.html
sidebar:
  - article-menu
---

<div class="post">
  <section>

    {%- assign name = 'banner' -%}
    {%- include functions.html func='get_value' -%}
    {%- assign banner = return -%}

    {%- assign result = page.hidden | where_exp: "item", "item == 'header'" -%}
    {%- if banner == nil and result.size == 0 -%}
    {%- include views/post-header.html -%}
    {%- endif -%}

    {%- include views/article.html -%}

    {%- assign result = page.hidden | where_exp: "item", "item == 'navigator'" -%}
    {%- if result.size == 0 -%}
    <div class="post-nav">
      {%- if page.previous -%}
        <a class="previous" href="{{ page.previous.url }}" title="{{
          page.previous.title | escape }}">{{ page.previous.title | escape | truncatewords: 6 }}</a>
      {%- else -%}
      <span></span>
      {%- endif -%}

      {%- if page.next -%}
        <a class="next" href="{{ page.next.url }}" title="{{ page.next.title | escape }}">{{ page.next.title | escape | truncatewords: 6 }}</a>
      {%- else -%}
      <span></span>
      {%- endif -%}
    </div>
    {%- endif -%}

    {%- assign result = page.hidden | where_exp: "item", "item == 'related_posts'" -%}
    {%- if result.size == 0 -%}
    <div class="post-related">
      <div>Related Articles</div>
      <ul>
        {% assign posts = site[page.collection] | sample:4 %}
        {%- for post in posts -%}
        <li><a class="post-link" href="{{post.url}}" title="{{ page.next.title | escape }}">{{ post.title | escape | truncatewords: 12 }}</a></li>
        {%- endfor -%}
      </ul>
    </div>
    {%- endif -%}

    {%- assign result = page.hidden | where_exp: "item", "item == 'comments'" -%}
    {%- if result.size == 0 -%}
    <div class="post-comments">
      {%- if page.comments != false -%}

      {%- if site.disqus.shortname -%}
      {%- include extensions/comments/disqus.html -%}
      {%- endif -%}

      {%- if site.gitment.username -%}
      {%- include extensions/comments/gitment.html -%}
      {%- endif -%}

      {%- endif -%}
    </div>
    {%- endif -%}

  </section>
</div>