{
  "id": "<%= entry.id %>",
  "title": <%= entry.title.to_json.html_safe %>,
  "read": <%= entry.read_by? user %>,
<% if entry.published.year == Date.today.year %>
  "published": "<%= l entry.published.in_time_zone(ActiveSupport::TimeZone[current_user.timezone]), format: :short %>",
<% else %>
  "published": "<%= l entry.published, format: :short_year %>",
<% end %>
  "url": "<%= entry.url %>",
  "guid": "<%= entry.guid %>",
  "content": <%= entry.content.try(:to_json).html_safe %>,
  "summary": <%= entry.summary.try(:to_json).html_safe %>,
  "feed_id": "<%= entry.feed_id %>"
}
{
  "id": "<%= entry.id %>",
  "title": <%= entry.title.to_json.html_safe %>,
  "read": <%= entry.read_by? user %>,
<% if entry.published.year == Date.today.year %>
  "published": "<%= l entry.published.in_time_zone(ActiveSupport::TimeZone[current_user.timezone]), format: :short %>",
<% else %>
  "published": "<%= l entry.published, format: :short_year %>",
<% end %>
  "url": "<%= entry.url %>",
  "guid": "<%= entry.guid %>",
<% if entry.content.present? %>
  "content": <%= entry.content.to_json.html_safe %>,
<% end %>
<% if entry.summary.present? %>
  "summary": <%= entry.summary.to_json.html_safe %>,
<% end %>
  "feed_id": "<%= entry.feed_id %>"
}
Add content and summary fields to JSON for an entry only if each field has value, respectively.
Add content and summary fields to JSON for an entry only if each field has value, respectively.
