Skip to content

Commit

Permalink
fix: do not override eleventyComputed
Browse files Browse the repository at this point in the history
Fixes #346
  • Loading branch information
lhokktyn authored and paulrobertlloyd committed Nov 6, 2024
1 parent ec4d8ac commit 801127c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
)

Expand Down
8 changes: 3 additions & 5 deletions lib/data/eleventy-computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 801127c

Please sign in to comment.