web/_layouts/post.html

126 lines
3.9 KiB
HTML
Raw Normal View History

2019-09-30 15:38:41 +03:00
---
layout: default
# The posts' layout
# © 2017-2019 Cotes Chung
# MIT Licensed
---
2019-11-27 22:58:31 +03:00
<div class="row">
2019-11-25 15:56:50 +03:00
{% include date-format.html %}
2019-09-30 15:38:41 +03:00
2019-11-25 15:56:50 +03:00
<div id="post-wrap" class="col-12 col-lg-11 col-xl-8">
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
2019-09-30 15:38:41 +03:00
<h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-meta text-muted d-flex flex-column">
<!-- Published Date and Categoreis -->
<div>
<span class="timeago" data-toggle="tooltip" title="{{ page.date | date: TOOLTIP_DATE }}">
{{ page.date | date: POST_DATE }}
<i class="hidden">{{ page.date | date_to_xmlschema }}</i>
</span>
2019-11-25 15:56:50 +03:00
{% if page.categories.size > 0 %}on{% endif %}
{% for category in page.categories %}
<a href='{{ site.baseurl }}/categories/{{ category | replace: ' ', '-' | downcase }}/'>{{ category }}</a>
{%- unless forloop.last -%}, {%- endunless -%}
{% endfor %}
2019-09-30 15:38:41 +03:00
</div>
2019-11-25 15:56:50 +03:00
2019-09-30 15:38:41 +03:00
<!-- lastmod -->
{% if page.seo.date_modified > page.date %}
<div>
Updated
<span class="timeago lastmod" data-toggle="tooltip" title="{{ page.seo.date_modified | date: TOOLTIP_DATE }}">
{{ page.seo.date_modified | date: POST_DATE }}
<i class="hidden">{{ page.seo.date_modified | date_to_xmlschema}}</i>
</span>
</div>
{% endif %}
2019-11-25 15:56:50 +03:00
2019-09-30 15:38:41 +03:00
<!-- page views -->
{% if site.google_analytics.pv %}
<div>
<span id="pv" class="pageviews"><i class="fas fa-spinner fa-spin"></i></span> views
</div>
{% endif %}
2019-11-25 15:56:50 +03:00
2019-09-30 15:38:41 +03:00
</div> <!-- .post-meta -->
2019-11-24 12:38:41 +03:00
{% capture post_content %}
2019-09-30 15:38:41 +03:00
<div class="post-content">
{% if page.image %}
<img src="{{ page.image }}" class="img-rounded">
{% endif %}
{{ content }}
2019-11-24 12:38:41 +03:00
</div>
{% endcapture %}
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
{% if post_content contains '<img src=' %}
{{ post_content | replace: '<img src=', '<img class="lozad" data-src=' }}
{% else %}
{{ post_content }}
{% endif %}
2019-09-30 15:38:41 +03:00
<div class="post-tail text-muted">
<!-- Tags -->
{% if page.tags.size > 0 %}
<div class="mb-4">
2019-09-30 15:38:41 +03:00
{% for tag in page.tags %}
<a href="{{ site.baseurl }}/tags/{{ tag | replace: ' ', '-' | downcase }}/"
class="post-tag no-text-decoration" >
{{- tag -}}
</a>{%- if forloop.last != true -%}&ensp;{%- endif -%}
{% endfor %}
2019-11-25 15:56:50 +03:00
</div>
2019-09-30 15:38:41 +03:00
{% endif %}
2019-11-25 15:56:50 +03:00
</div><!-- div.post-tail -->
2019-09-30 15:38:41 +03:00
2019-11-27 12:08:54 +03:00
</div> <!-- .post -->
</div> <!-- #post-wrap -->
{% include panel.html %}
</div> <!-- .row -->
2019-11-27 22:58:31 +03:00
<div class="row">
2019-11-27 12:08:54 +03:00
<div id="post-extend-wrap" class="col-12 col-lg-11 col-xl-8">
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
2019-11-25 15:56:50 +03:00
{% include related-posts.html %}
2019-09-30 15:38:41 +03:00
2019-11-25 15:56:50 +03:00
<div class="post-pager d-flex justify-content-between">
{% if page.previous.url %}
<a href="{{ site.baseurl }}{{page.previous.url}}" class="btn btn-outline-primary">
{% else %}
<a href="javascript:;" class="btn btn-outline-primary disabled">
{% endif %}
<i class="fas fa-angle-left mr-1"></i>
OLDER POST
</a>
2019-11-25 15:56:50 +03:00
{% if page.next.url %}
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary">
{% else %}
<a href="javascript:;" class="btn btn-outline-primary disabled">
{% endif %}
NEWER POST
<i class="fas fa-angle-right ml-1"></i>
</a>
</div> <!-- div.post-pager -->
2019-09-30 15:38:41 +03:00
{% if site.disqus.comments and page.comments %}
{% include disqus.html %}
{% endif %}
2019-11-27 12:08:54 +03:00
</div> <!-- .pl-1 pr-1 -->
</div> <!-- wrap -->
2019-09-30 15:38:41 +03:00
2019-11-25 15:56:50 +03:00
</div> <!-- .row -->
2019-11-24 12:38:41 +03:00
<!-- image lazy load -->
<script type="text/javascript">
const observer = lozad();
observer.observe();
</script>