1 | const url = require("url");
|
2 | const e = require("./element");
|
3 |
|
4 | // TODO: Push to another package or use a pre-existing one over this
|
5 | module.exports = function({
|
6 | baseUrl,
|
7 | sections = [],
|
8 | updated,
|
9 | pages,
|
10 | config,
|
11 | get,
|
12 | }) {
|
13 | return e.feed([
|
14 | e.title(config.title),
|
15 | e.link(url.resolve(baseUrl, "/atom.xml"), "self"),
|
16 | e.link(baseUrl),
|
17 | e.updated(updated),
|
18 | e.id(baseUrl),
|
19 | e.author(config.author),
|
20 | e.entries({ baseUrl, sections, pages, get }),
|
21 | ]);
|
22 | };
|