From 801127cf31a0c6b40100efb0aa1eacd7d5f72486 Mon Sep 17 00:00:00 2001 From: lhokktyn <810615+lhokktyn@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:42:48 +0100 Subject: [PATCH] fix: do not override eleventyComputed Fixes #346 --- index.js | 2 +- lib/data/eleventy-computed.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 11c200fc..c7ecd5c4 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ module.exports = function (eleventyConfig, pluginOptions = {}) { // Global data eleventyConfig.addGlobalData('options', options) eleventyConfig.addGlobalData( - 'eleventyComputed', + 'eleventyComputed.eleventyNavigation', require('./lib/data/eleventy-computed.js') ) diff --git a/lib/data/eleventy-computed.js b/lib/data/eleventy-computed.js index 35a5cb66..51e98c9e 100644 --- a/lib/data/eleventy-computed.js +++ b/lib/data/eleventy-computed.js @@ -37,9 +37,7 @@ const getParent = (data) => { * @see {@link https://www.11ty.dev/docs/plugins/navigation/} */ module.exports = { - eleventyNavigation: { - key: (data) => getKey(data), - parent: (data) => getParent(data), - excerpt: (data) => data.eleventyNavigation.excerpt || data.description - } + key: (data) => getKey(data), + parent: (data) => getParent(data), + excerpt: (data) => data.eleventyNavigation.excerpt || data.description }