From 5371faac79a169be47a699434357e2a3b3d80e04 Mon Sep 17 00:00:00 2001 From: st1020 Date: Wed, 31 Jul 2024 21:17:16 +0800 Subject: [PATCH] feat: replace `extra.author` with `authors` in the page front matter --- templates/partials/head.html | 16 +++++++++++++--- templates/partials/page_info.html | 11 +++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/templates/partials/head.html b/templates/partials/head.html index 888839b..2476f88 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -17,8 +17,19 @@ {% set page_title = page.title | default(value=config.title) %} {% set description = page.description | default(value=page_title) %} + + {% if page.authors | length > 0 %} + + {% set author = page.authors | join(sep=", ") %} + + {% else %} + + {% set author = config.author | default(value=config.title) %} + + {% endif %} + - + @@ -109,8 +120,7 @@ title="Atom" href="{{ get_url(path=`atom.xml`) }}" /> - {% endif %} - {% if "rss.xml" in config.feed_filenames %} + {% endif %} {% if "rss.xml" in config.feed_filenames %} · {{ page.reading_time }}min {% 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 %} · - {{ single_author }} + {{ author }} {% endif %}