Okay, with a jsonfeed 1 feed, and starting from an Observable API parsed-json notebook n
, this seems to work for a feed item, properly giving the author a name and icon in my feed reader:
({
id: n.id,
date_published: n.publish_time,
date_modified: n.update_time,
title: n.title,
content_html: `<img src="https://static.observableusercontent.com/thumbnail/${n.thumbnail}.jpg">`,
image: `https://static.observableusercontent.com/thumbnail/${n.thumbnail}.jpg`,
url: `https://observablehq.com/@${n.owner.login}/${n.slug}`,
author: {
name: n.creator.name || n.creator.login,
url: `https://observablehq.com/@${n.creator.login}`,
avatar: n.creator.avatar_url
}
})
(Not sure if there might be some advantage to turning category names into ‘tags’ for each notebook.)
If the author is the same for every item in the feed (e.g. it is an author feed, rather than /recent), then the author object can be put at top level instead of into each item separately.
For /recent, the top level content might be something like:
({
version: "https://jsonfeed.org/version/1",
title: "Recent Notebooks – Observable",
description: "The firehose of all published notebooks at https://observablehq.com/",
home_page_url: "https://observablehq.com/recent",
feed_url: "https://api.observablehq.com/documents/public.json",
favicon: "https://static.observablehq.com/favicon-512.0667824687f99c942a02e06e2db1a060911da0bf3606671676a255b1cf97b4fe.png",
icon: "https://static.observablehq.com/favicon-512.0667824687f99c942a02e06e2db1a060911da0bf3606671676a255b1cf97b4fe.png",
items: [
...
]
})
For author feeds I would recommend setting top-level icon and favicon to the author’s avatar URL.
Jsonfeed 1.1 replaced ‘author’ with ‘authors’ (a list), but it is only a few months old and I am not sure if feed readers have caught up yet.