diff --git a/package.json b/package.json index 3f91ef3..f21de3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fwdekker/template", - "version": "2.3.1", + "version": "2.4.0", "description": "The base template for pages on fwdekker.com.", "author": "Felix W. Dekker", "license": "MIT", diff --git a/src/main/js/main.js b/src/main/js/main.js index c86279d..6fd334e 100644 --- a/src/main/js/main.js +++ b/src/main/js/main.js @@ -47,9 +47,10 @@ const doAfterLoad = function(fun) { * Fetches entries asynchronously from the website's API. * * @param [highlightPath] {String} the path to highlight together with its parents + * @param [cb] {Function} the callback to execute on the fetched entries, to prevent the need to re-fetch elsewhere * @returns {HTMLElement} a base navigation element that will eventually be filled with contents */ -const nav = function(highlightPath = "") { +const nav = function(highlightPath = "", cb = undefined) { const base = stringToHtml( `