Skip to content

Commit 5371faa

Browse files
committed
feat: replace extra.author with authors in the page front matter
1 parent c2a7f40 commit 5371faa

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

templates/partials/head.html

+13-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,19 @@
1717
{% set page_title = page.title | default(value=config.title) %}
1818
<!---->
1919
{% set description = page.description | default(value=page_title) %}
20+
<!---->
21+
{% if page.authors | length > 0 %}
22+
<!---->
23+
{% set author = page.authors | join(sep=", ") %}
24+
<!---->
25+
{% else %}
26+
<!---->
27+
{% set author = config.author | default(value=config.title) %}
28+
<!---->
29+
{% endif %}
30+
<!---->
2031
<meta name="description" content="{{ description }}" />
21-
<meta name="author" content="{{ page.extra.author | default(value=page_title) }}" />
32+
<meta name="author" content="{{ author }}" />
2233
<!-- The Open Graph protocol -->
2334
<meta property="og:type" content="website" />
2435
<meta property="og:title" content="{{ page_title }}" />
@@ -109,8 +120,7 @@
109120
title="Atom"
110121
href="{{ get_url(path=`atom.xml`) }}"
111122
/>
112-
{% endif %}
113-
{% if "rss.xml" in config.feed_filenames %}
123+
{% endif %} {% if "rss.xml" in config.feed_filenames %}
114124
<link
115125
rel="alternate"
116126
type="application/rss+xml"

templates/partials/page_info.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
<span class="mx-1">&middot;</span>
55
<span>{{ page.reading_time }}min</span>
66
{% endif %}<!---->
7-
{% set single_author = page.extra.author | default(value=config.author) %}
8-
<!---->
9-
{% if single_author %}
7+
{% if page.authors | length > 0 %}<!---->
8+
{% set author = page.authors | join(sep=", ") %}<!---->
9+
{% else %}<!---->
10+
{% set author = config.author %}<!---->
11+
{% endif %}<!---->
12+
{% if author %}
1013
<span class="mx-1">&middot;</span>
11-
<span>{{ single_author }}</span>
14+
<span>{{ author }}</span>
1215
{% endif %}
1316
</div>

0 commit comments

Comments
 (0)