Skip to content

Commit

Permalink
feat: show author for posts that specify one (#122)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
tchebb and jeffreytse committed Aug 24, 2023
1 parent 3de3140 commit 2301024
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _includes/views/pagination-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ <h2 class="post-title">
</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 }}">
Expand Down
4 changes: 4 additions & 0 deletions _includes/views/post-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ <h2 class="post-subtitle">{{ subheading | default: page.subtitle | escape }}</h2
<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' -%}
Expand Down

0 comments on commit 2301024

Please sign in to comment.