Skip to content

Commit

Permalink
Allow author to accept an object or string
Browse files Browse the repository at this point in the history
Fixes #289
  • Loading branch information
mmistakes committed Jan 8, 2018
1 parent 7c63484 commit 176261c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
7 changes: 2 additions & 5 deletions _includes/author-profile.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{% if page.author and site.data.authors[page.author] %}
{% assign author = site.data.authors[page.author] %}
{% else %}
{% assign author = site.author %}
{% endif %}
{% assign author = page.author | default: page.authors[0] | default: site:author %}
{% assign author = site.data.authors[author] | default: author %}

<div itemscope itemtype="http://schema.org/Person">

Expand Down
25 changes: 12 additions & 13 deletions _includes/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,20 @@

<meta name="description" content="{{ seo_description }}">

{% assign seo_author = page.author | default: page.author[0] | default: site.author.name %}
{% if seo_author %}
{% if seo_author.twitter %}
{% assign seo_author_twitter = seo_author.twitter %}
{% else %}
{% if site.data.authors and site.data.authors[seo_author] %}
{% assign seo_author_twitter = site.data.authors[seo_author].twitter %}
{% else %}
{% assign seo_author_twitter = seo_author %}
{% endif %}
{% endif %}
{% assign seo_author_twitter = seo_author_twitter | replace: "@", "" %}
{% assign author = page.author | default: page.authors[0] | default: site:author %}
{% assign author = site.data.authors[author] | default: author %}

{% if author.twitter %}
{% assign author_twitter = author.twitter | replace: "@", "" %}
{% endif %}

<meta name="author" content="{{ seo_author }}">
{% if author.name %}
<meta name="author" content="{{ author.name | default: author }}">
{% endif %}

{% if page.date %}
<meta property="og:type" content="article">
{% endif %}

<meta property="og:locale" content="{{ site.locale | replace: "-", "_" | default: "en_US" }}">
<meta property="og:site_name" content="{{ site.title }}">
Expand Down

0 comments on commit 176261c

Please sign in to comment.