jekyll / jekyll-feed

:memo: A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
MIT License
834 stars 201 forks source link

Author field returned in raw object #299

Open pingu8007 opened 4 years ago

pingu8007 commented 4 years ago

Since Atom feed is extended from XML, an author field should be something human readable. This plugin, however, return an object-like string in this field. I can't find an example with twitter handle, just a feeling.

I have following plugin enabled:

Input

# _data/authors.yml
PinGu:
  twitter: pinguotaku
  picture: /images/avatar.png
  url: http://example.org/
# _config.yml
author: PinGu

Expected output

I don't know which is correct but it should be a text at least.

<feed>
  <author>
    <name>PinGu</name>
    <url>http://example.org/</url>
  </author>
  <entry>
    <author>
      <name>PinGu</name>
      <url>http://example.org/</url>
    </author>
  </entry>
</feed>

or

<feed>
  <author>
    <name>@pinguotaku</name>
    <url>http://example.org/</url>
  </author>
  <entry>
    <author>
      <name>@pinguotaku</name>
      <url>http://example.org/</url>
    </author>
  </entry>
</feed>

Actual output

<feed>
  <author>
    <name>PinGu</name> # Not following _data/authors.yml
  </author>
  <entry>
    <author>
      <name>{"twitter"=>"pinguotaku", "picture"=>"/images/avatar.png", "url"=>"http://example.org/"}</name> # object-like string with all value
    </author>
  </entry>
</feed>

Workaround

Add key name to author

# _data/authors.yml
PinGu:
  name: Pin
  twitter: pinguotaku
  picture: /images/avatar.png
  url: http://example.org/

and the result will be

<feed>
  <author>
    <name>PinGu</name> # Still not following _data/authors.yml
  </author>
  <entry>
    <author>
      <name>Pin</name> # Only name field, others are missing
    </author>
  </entry>
</feed>
pingu8007 commented 4 years ago

Issue still exist in version 0.14.0

qdread commented 3 years ago

Confirming that this issue still exists, though I was able to use @pingu8007 's workaround successfully.