pages/_layouts/post.html
Maruan b9f1fc84f2
Add support for giscus comments (#1028)
adds support for comments on posts using https://giscus.app/
2022-12-11 22:33:09 -05:00

54 lines
1.6 KiB
HTML

---
layout: default
---
<!-- _layouts/post.html -->
{%- assign year = page.date | date: "%Y" -%}
{%- assign tags = page.tags | join: "" -%}
{%- assign categories = page.categories | join: "" -%}
{% if page._styles %}
<!-- Page/Post style -->
<style type="text/css">
{{ page._styles }}
</style>
{% endif %}
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-meta">{{ page.date | date: "%B %-d, %Y" }}{%- if page.author -%} • {{ page.author }}{%- endif -%}{%- if page.meta -%} • {{ page.meta }}{%- endif -%}</p>
<p class="post-tags">
<a href="{{ year | prepend: '/blog/' | prepend: site.baseurl}}"> <i class="fas fa-calendar fa-sm"></i> {{ year }} </a>
{%- if tags != "" %}
&nbsp; &middot; &nbsp;
{% for tag in page.tags -%}
<a href="{{ tag | slugify | prepend: '/blog/tag/' | prepend: site.baseurl}}">
<i class="fas fa-hashtag fa-sm"></i> {{ tag }}</a> &nbsp;
{% endfor -%}
{% endif %}
{%- if categories != "" %}
&nbsp; &middot; &nbsp;
{% for category in page.categories -%}
<a href="{{ category | slugify | prepend: '/blog/category/' | prepend: site.baseurl}}">
<i class="fas fa-tag fa-sm"></i> {{ category }}</a> &nbsp;
{% endfor -%}
{% endif %}
</p>
</header>
<article class="post-content">
{{ content }}
</article>
{%- if site.disqus_shortname and page.disqus_comments -%}
{% include disqus.html %}
{%- endif %}
{%- if site.giscus.repo and page.giscus_comments -%}
{% include giscus.html %}
{%- endif -%}
</div>