1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Add a link to the author of the post

This commit is contained in:
Cotes Chung
2021-12-05 02:29:40 +08:00
parent 563e8085e8
commit e2003f2b03
8 changed files with 45 additions and 10 deletions

View File

@@ -16,8 +16,23 @@ tail_includes:
<!-- author -->
<div>
{% capture author_name %}{{ page.author.name | default: site.social.name }}{% endcapture %}
{% assign author_link = nil %}
{% if page.author.link %}
{% assign author_link = page.author.link %}
{% elsif author_name == site.social.name %}
{% assign author_link = site.social.links[0] %}
{% endif %}
{{ site.data.locales[lang].post.written_by }}
<em>{{ page.author | default: site.social.name }}</em>
<em>
{% if author_link %}
<a href="{{ author_link }}">{{ author_name }}</a>
{% else %}
{{ author_name }}
{% endif %}
</em>
</div>
<div class="d-flex">