Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill entry.author element with proper value when author name is unavailable #300

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/jekyll-feed/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,18 @@
{% endunless %}

{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
{% assign post_author_name = nil %}
{% unless post_author.first %}
{% assign post_author_name = post_author %}
{% endunless %}
{% assign post_author = site.data.authors[post_author] | default: post_author %}
{% assign post_author_email = post_author.email | default: nil %}
{% assign post_author_uri = post_author.uri | default: nil %}
{% assign post_author_name = post_author.name | default: post_author %}
{% assign post_author_twitter = post_author.twitter | default: nil %}
{% if post_author_twitter %}
{% assign post_author_twitter = post_author.twitter | prepend: "@" %}
{% endif %}
ashmaroli marked this conversation as resolved.
Show resolved Hide resolved
{% assign post_author_name = post_author.name | default: post_author_twitter | default: post_author_name | default: post_author %}

<author>
<name>{{ post_author_name | default: "" | xml_escape }}</name>
Expand Down