pages/_layouts/post.html
Maruan 8893d483bc
Update giscus setup via github action (#1792)
giscus settings in `_config.yml` had al-folio repo specified by default.
many users kept these defaults in their own repos, which resulted in
getting comments from blog posts of different users posted to al-folio
discussions. this is undesirable, since users lose control over the
discussions in their blogs.

this PR solves the issue:
- first, we set `giscus.repo` to blank in `_config.yml`. if the field is
kept blank, when the website is built locally, the user will see a
warning saying that giscus comments are misconfigured.
- second, we add a step to the `deploy` workflow that writes repository
name to `giscus.repo` in `_config.yml`. that way, even if `giscus.repo`
field is left black or set to an incorrect repo, it gets correctly
populated at deployment time.

other small changes in this PR are small stylistic adjustments.
2023-10-04 22:27:36 -04:00

76 lines
2.3 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">
{% if page.toc and page.toc.beginning %}
<div id="table-of-contents">
{% toc %}
</div>
<hr>
{% endif %}
<div id="markdown-content">
{{ content }}
</div>
</article>
{%- if page.related_publications != null and page.related_publications.size > 0 -%}
{% assign publications = page.related_publications | replace: ", ", "," | split: "," | join: "|" %}
<h2>References</h2>
<div class="publications">
{% bibliography -f {{ site.scholar.bibliography }} -q @*[key^={{ publications }}]* %}
</div>
{%- endif %}
{%- if site.related_blog_posts.enabled -%}
{%- if page.related_posts == null or page.related_posts -%}
{% include related_posts.html %}
{%- endif %}
{%- endif %}
{%- if site.disqus_shortname and page.disqus_comments -%}
{% include disqus.html %}
{%- endif %}
{%- if site.giscus and page.giscus_comments -%}
{% include giscus.html %}
{%- endif -%}
</div>