Skip to content

Commit

Permalink
feat: replace extra.author with authors in the page front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Jul 31, 2024
1 parent c2a7f40 commit 5371faa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
16 changes: 13 additions & 3 deletions templates/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<!---->
<meta name="description" content="{{ description }}" />
<meta name="author" content="{{ page.extra.author | default(value=page_title) }}" />
<meta name="author" content="{{ author }}" />
<!-- The Open Graph protocol -->
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ page_title }}" />
Expand Down Expand Up @@ -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 %}
<link
rel="alternate"
type="application/rss+xml"
Expand Down
11 changes: 7 additions & 4 deletions templates/partials/page_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 5371faa

Please sign in to comment.