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 all commits
Commits
File filter

Filter by extension

Filter by extension

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

{% assign post_author = post.author | default: post.authors[0] | default: site.author %}
{% if post_author.first %}
{% assign post_author_name = nil %}
{% else %}
{% assign post_author_name = post_author %}
{% endif %}
{% 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 %}
{% if post_author.twitter %}
{% assign post_author_twitter = post_author.twitter | prepend: "@" %}
{% else %}
{% assign post_author_twitter = nil %}
{% 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