summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hebb <tommyhebb@gmail.com>2023-08-23 19:52:54 -0700
committerJeffrey Tse <jeffreytse.mail@gmail.com>2023-08-24 21:40:53 +0800
commit23010243d8850e56e872c112ab6f5c75efe60a38 (patch)
tree33b94adabe2e79117ddd6e5784488bda1c37672d
parent3de31401ff89b80a94f442ba3eaba7fa9b0eaa00 (diff)
feat: show author for posts that specify one (#122)
* feat: show author for posts that specify one Posts by default inherit the site's author, but it's possible to override that per post, which affects--e.g.--the RSS metadata. For posts that do so, we don't currently show that anywhere in the theme. Add a new piece of metadata to posts, along with the date and reading time, that displays the author only when it's not inherited from the site. * Update pagination-item.html --------- Co-authored-by: JT <jeffreytse.mail@gmail.com>
-rw-r--r--_includes/views/pagination-item.html3
-rw-r--r--_includes/views/post-header.html4
2 files changed, 7 insertions, 0 deletions
diff --git a/_includes/views/pagination-item.html b/_includes/views/pagination-item.html
index bea6d91..fff6541 100644
--- a/_includes/views/pagination-item.html
+++ b/_includes/views/pagination-item.html
@@ -17,6 +17,9 @@
</h2>
<div class="post-meta">
<span class="post-date"><i class="fa fa-calendar"></i> {{ post.date | date: date_format }}</span>
+ {%- if post.author -%}
+ <span class="post-author left-vsplit"><i class="fa fa-pencil"></i> {{ post.author | escape }}</span>
+ {%- endif -%}
<span class="post-reading-time left-vsplit"><i class="fa fa-clock-o"></i> {{ reading_time }}</span>
</div>
<a class="post-excerpt" href="{{ post_url }}">
diff --git a/_includes/views/post-header.html b/_includes/views/post-header.html
index 33bbdaa..b6ea964 100644
--- a/_includes/views/post-header.html
+++ b/_includes/views/post-header.html
@@ -8,6 +8,10 @@
<i class="fa fa-calendar"></i> {{ page.date | date: date_format }}
</time>
+ {%- if page.author -%}
+ <span class="post-author left-vsplit"><i class="fa fa-pencil"></i> {{ page.author | escape }}</span>
+ {%- endif -%}
+
{% assign article = page.content %}
{% assign lang = page.lang %}
{%- include functions.html func='get_reading_time' -%}