Skip to content

Commit db21203

Browse files
docs: enriched post properties
1 parent 1305b0e commit db21203

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/options.md

+51
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,57 @@ Example, using a URL:
216216

217217
---
218218

219+
### publication.enrichPostData `boolean`
220+
221+
Fetch and append data about URLs referenced in new posts.
222+
223+
_Optional_, defaults to `false`. For example:
224+
225+
```json
226+
{
227+
"publication": {
228+
"enrichPostData": true
229+
}
230+
}
231+
```
232+
233+
When enabled, Indiekit will try to fetch Microformats data for any URL in a new post (for example URLs for `bookmark-of`, `like-of`, `repost-of`, `in-reply-to`).
234+
235+
If any data is found, a `references` property will be included in the resulting post data. For example, given the following Micropub request:
236+
237+
```http
238+
POST /micropub HTTP/1.1
239+
Host: indiekit.mywebsite.com
240+
Content-type: application/x-www-form-urlencoded
241+
Authorization: Bearer XXXXXXX
242+
243+
h=entry
244+
&content=This+made+me+very+hungry.
245+
&bookmark-of=https://website.example/notes/123
246+
```
247+
248+
should the note post at `https://website.example/notes/123` include Microformats, the following post data would be generated:
249+
250+
```js
251+
{
252+
date: "2022-11-03T22:00:00",
253+
"bookmark-of": "https://website.example/notes/123",
254+
content: "This made me very hungry.",
255+
references: {
256+
"https://website.example/notes/123": {
257+
type: "entry",
258+
published: "2013-03-07",
259+
content: "I ate a cheese sandwich, which was nice.",
260+
url: "https://website.example/notes/123"
261+
}
262+
}
263+
}
264+
```
265+
266+
This referenced Microformats data could then be used in the design of your website to provide extra information about the content you are linking to.
267+
268+
---
269+
219270
### publication.locale `string`
220271

221272
Your publication’s locale. Currently used to format dates.

0 commit comments

Comments
 (0)