Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

Articles Carousel: Repeated date on frontend if post has been updated #452

Closed jeryj closed 4 years ago

jeryj commented 4 years ago

If a post has been updated and is included in the Articles Carousel, it will show both the publish date and updated date.

To Reproduce Steps to reproduce the behavior:

  1. Have two or more posts with featured images
  2. Update one of the posts with new content
  3. Add the articles carousel to a page
  4. Publish the page
  5. Visit the page and see that the post in the carousel shows a repeated date

Screenshots

Screen Shot 2020-05-01 at 9 41 21 AM

Expected behavior I think it should only show the publish date or the updated date.

jeffersonrabb commented 4 years ago

@laurelfulford do you recall why we added the update date here? https://github.com/Automattic/newspack-blocks/blob/master/src/blocks/homepage-articles/templates/article.php#L126

Testing the standalone plugin I never see the doubled date so I haven't been able to replicate this issue. Would there be any harm in removing it from Homepage Posts and Carousel?

laurelfulford commented 4 years ago

It's part of a microformats spec that's often used in themes:

http://microformats.org/wiki/hentry

The doubled date is probably coming from the carousel not explicitly hiding the updated version of the date -- we had the same issue with the Homepage Posts block, because it was assuming that all themes would be hiding that class (which is a bad assumption!).

I think it's probably safe to remove, since we're not implementing it fully (the posts in these blocks don't have the .hentry class; I'm not sure we're using all the classes we should). If we opt to add that down the road, we'd want to make sure that was all done correctly -- as is I think it's a partial copy-pasta from the theme :)

matticbot commented 4 years ago

:tada: This issue has been resolved in version 1.5.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: