diff --git a/CHANGELOG.md b/CHANGELOG.md index 9587bf67afce..33735c02bef0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ ## Unreleased version - - BREAKING CHANGE: Allow changing the order of the social network links that appear in the footer (#1152) -- BREAKING CHANGE: `google-scholar` social network link no longer requires the prefix `citations?user=`; if you previously set this parameter, it needs to be updated (#1189) -- Fixed bug where hovering over search results showed the text "{desc}" (#1156) +- BREAKING CHANGE: `google-scholar` social network link no longer requires the prefix `citations?user=`; if you previously set this parameter, it needs to be updated (#1189) +- Added `author` YAML parameter to allow specifying the author(s) of a post (#1220) +- Fixed bug where hovering over search results showed the text "{desc}" (#1156) - Added social network links for GitLab, Bluesky (#1168, #1218) - Added instructions and example on how to fix image links in project sites (#1171) - Pagination buttons: use nicer arrows, and don't show text on small screens (#1221) diff --git a/README.md b/README.md index 825a34298615..7f96ae38ba51 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ These are parameters that you may not use often, but can come in handy sometimes Parameter | Description ----------- | ----------- +author | Specify the author of a blog post (useful if a website has multiple authors). readtime | If you want a post to show how many minutes it will take to read it, use `readtime: true`. show-avatar | If you have an avatar configured in the `_config.yml` but you want to turn it off on a specific page, use `show-avatar: false`. social-share | By default, every blog post has buttons to share the page on social media. If you want to turn this feature off, use `social-share: false`. diff --git a/_includes/head.html b/_includes/head.html index ac3e13409c23..9b5f1c83aea5 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -25,8 +25,15 @@ {{ title }} - {% if site.author %} - + {% capture author %} + {%- if page.author -%} + {{ page.author | strip_html }} + {%- elsif site.author -%} + {{ site.author }} + {%- endif -%} + {% endcapture %} + {% if author != "" %} + {% endif %} @@ -112,7 +119,9 @@ {% if page.id %} - + {% if author != "" %} + + {% endif %} diff --git a/_includes/header.html b/_includes/header.html index 4de419e543a3..7f15fc78bf10 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -36,8 +36,11 @@

{% if page.title %}{{ page.title | strip_html }}{% else %}
{% endif %}{{ page.subtitle | strip_html }}

{% endif %} {% endif %} - - {% if include.type == "post" %} + + {% if include.type == "post" %} + {% if page.author %} + By {{ page.author | strip_html }}
+ {% endif%} Posted on {{ page.date | date: date_format }} {% if page.last-updated %} @@ -71,7 +74,10 @@

{{ page.subtitle | strip_html }}

{% endif %} {% endif %} - {% if include.type == "post" %} + {% if include.type == "post" %} + {% if page.author %} + By {{ page.author | strip_html }}
+ {% endif%} Posted on {{ page.date | date: date_format }} {% if page.last-updated %} diff --git a/_layouts/home.html b/_layouts/home.html index 9e4d04fcdd04..be4c555ab9e4 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -46,6 +46,9 @@

{% endif %} + {% if post.author %} + By {{ post.author | strip_html }} + {% endif %}