feat: replace extra.author with authors in the page front matter

This commit is contained in:
st1020 2024-07-31 21:17:16 +08:00
parent c2a7f409f0
commit 5371faac79
2 changed files with 20 additions and 7 deletions

View file

@ -4,10 +4,13 @@
<span class="mx-1">&middot;</span>
<span>{{ page.reading_time }}min</span>
{% endif %}<!---->
{% set single_author = page.extra.author | default(value=config.author) %}
<!---->
{% if single_author %}
{% if page.authors | length > 0 %}<!---->
{% set author = page.authors | join(sep=", ") %}<!---->
{% else %}<!---->
{% set author = config.author %}<!---->
{% endif %}<!---->
{% if author %}
<span class="mx-1">&middot;</span>
<span>{{ single_author }}</span>
<span>{{ author }}</span>
{% endif %}
</div>