From 0f9e334a19e7224ee08b611107029b4cd86c0267 Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 4 Dec 2023 18:30:19 +0100 Subject: Support file imports for .txt and .json (#25) --- examples/urls_from_file.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 examples/urls_from_file.js (limited to 'examples/urls_from_file.js') diff --git a/examples/urls_from_file.js b/examples/urls_from_file.js new file mode 100644 index 0000000..0231032 --- /dev/null +++ b/examples/urls_from_file.js @@ -0,0 +1,11 @@ +import urls from "./urls.txt" + +export const config = { + urls: urls.split("\n").filter(Boolean) +}; + +export default function({ doc }) { + return { + title: doc.find("title").text().trim(), + }; +} -- cgit v1.2.3