jekyll-feed icon indicating copy to clipboard operation
jekyll-feed copied to clipboard

Author field returned in raw object

Open pingu8007 opened this issue 5 years ago • 2 comments

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:

  • jekyll-sitemap (1.2.0)
  • jekyll-feed (0.13.0)
  • jekyll-seo-tag (2.5.0)

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 avatar Feb 15 '20 15:02 pingu8007

Issue still exist in version 0.14.0

pingu8007 avatar Jul 10 '20 01:07 pingu8007

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

qdread avatar Dec 02 '20 14:12 qdread