Function

atomFeed(title:author:baseURL:summary:image:dateKeyPath:)

@preconcurrency
func atomFeed<Context, M>(
  title: String,
  author: String? = nil,
  baseURL: URL,
  summary: ((Item<M>) -> String?)? = nil,
  image: ((Item<M>) -> String?)? = nil,
  dateKeyPath: KeyPath<Item<M>, Date> = \.lastModified
) -> ((Context) -> String) where Context : AtomContext, M == Context.M

A renderer which creates an Atom feed for Items

Parameters

title

The title of the feed, usually your site title. Example: Loopwerk.io.

author

The author of the articles.

baseURL

The base URL of your website, for example https://www.loopwerk.io.

summary

An optional function which takes an Item and returns its summary.

image

An optional function which takes an Item and returns its image URL (absolute or relative to baseURL).

dateKeyPath

A keypath to the date property to use for thefield. Defaults to \.lastModified.

Return Value

A function which takes a rendering context, and returns a string.