From bdd8fc50fdc70a95d76591064ff74b66cdb5507a Mon Sep 17 00:00:00 2001
From: Eloi Perdereau <eloi@perdereau.eu>
Date: Sun, 8 Dec 2019 17:40:30 +0100
Subject: [PATCH] change how author is assigned, use site.author

---
 _includes/author-profile.html | 6 +-----
 _includes/seo.html            | 4 +---
 _layouts/single.html          | 7 ++-----
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/_includes/author-profile.html b/_includes/author-profile.html
index 884f262..9ef529c 100644
--- a/_includes/author-profile.html
+++ b/_includes/author-profile.html
@@ -1,9 +1,5 @@
 <!-- {% assign author = page.author | default: page.authors[0] | default: site.author %} -->
-{% unless page.author %}
-  {% assign author = page.url | split: "/" %}
-  {% assign author = author[1] %}
-{% endunless %}
-{% assign author = site.data.authors.authors | where: "prefix", author | first %}
+{% assign author = site.data.authors.authors | where: "prefix", site.author | first %}
 
 <div itemscope itemtype="https://schema.org/Person">
 
diff --git a/_includes/seo.html b/_includes/seo.html
index f4415d3..5e6e147 100644
--- a/_includes/seo.html
+++ b/_includes/seo.html
@@ -26,9 +26,7 @@
 {%- endif -%}
 
 <!-- don't use page.author even if it is set, find author based on url -->
-{% assign author = page.url | split: "/" %}
-{% assign author = author[1] %}
-{% assign author = site.data.authors.authors | where: "prefix", author | first %}
+{% assign author = site.data.authors.authors | where: "prefix", site.author | first %}
 
 {%- if author.twitter -%}
   {%- assign author_twitter = author.twitter | replace: "@", "" -%}
diff --git a/_layouts/single.html b/_layouts/single.html
index 05f2477..cf9d134 100644
--- a/_layouts/single.html
+++ b/_layouts/single.html
@@ -2,11 +2,7 @@
 layout: default
 ---
 
-{% unless page.author %}
-  {% assign author = page.url | split: "/" %}
-  {% assign author = author[1] %}
-{% endunless %}
-{% assign author = site.data.authors.authors | where: "prefix", author | first %}
+{% assign author = site.data.authors.authors | where: "prefix", site.author | first %}
 
 {% if page.has_header %}
   {% include page__hero.html %}
@@ -19,6 +15,7 @@ layout: default
 {% endif %}
 
 <div id="main" role="main">
+coucou
   {% include sidebar.html %}
 
   <article class="page" itemscope itemtype="https://schema.org/CreativeWork">
-- 
GitLab