Skip to content

Commit c1d0306

Browse files
committed
Limit depth of rolling variables
Limits the depth of rolling variables to 1, 3 5 and 7. This is not explicitly required by depctrl, but having a macro with the namespace or a channel with the `fileBaseUrl` can cause undefined behaviour.
1 parent ccf0642 commit c1d0306

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/_data/depctrl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function fillTemplateVar(data, repDict = {}, parentKey = "", depth = 0) {
228228
}
229229

230230
// Collect "Rolling" Variables
231-
if ("fileBaseUrl" in data) {
231+
if ("fileBaseUrl" in data && [1, 3, 5, 7].includes(depth)) {
232232
// Create repDict entry if not already existant
233233
repDict["fileBaseUrl"] = repDict["fileBaseUrl"] || "";
234234
// Do template replacement on fileBaseUrl

0 commit comments

Comments
 (0)