From e7002614c17bb2838804911f9755a30d056d4ff7 Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 17 Feb 2020 00:05:36 +0100 Subject: [PATCH] chore: move findExistingDefinition into own file --- .eleventy.js | 3 +-- 11ty/filters/helpers/findExistingDefinition.js | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 11ty/filters/helpers/findExistingDefinition.js diff --git a/.eleventy.js b/.eleventy.js index 2c88bf31..cb77b44a 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,6 +1,5 @@ const makeItemLink = (slug) => `#${slug}`; -const findExistingDefinition = (word, collection) => - collection.find((item) => item.data.title === word); +const findExistingDefinition = require('./11ty/filters/helpers/findExistingDefinition'); module.exports = function(config) { // Add a filter using the Config API diff --git a/11ty/filters/helpers/findExistingDefinition.js b/11ty/filters/helpers/findExistingDefinition.js new file mode 100644 index 00000000..bb21ad60 --- /dev/null +++ b/11ty/filters/helpers/findExistingDefinition.js @@ -0,0 +1,2 @@ +module.exports = (word, collection) => + collection.find((item) => item.data.title === word);