Open justinfagnani opened 4 years ago
I just hit this issue as well. I think this might be the problem:
These will be parsed with the current template’s rendering engine
Use Data Variables in Permalink
Since your template is markdown the permalink is parsed using Liquid (the default Markdown templating engine), even though the permalink itself is defined in a JS file.
I initially worked around this by specifying the permalink using a Liquid string (e.g. permalink: "{{page.filePath}}"
), but this breaks the second you have a different template engine. I have mostly markdown in a directory, plus some 11ty.js
templates. The JS templates appear to just output the permalink as a string literal, so I get files like _site/{{page.filePath}}/index.html
Describe the bug A permalink function in a data object is never being called, but it's presence is causing an exception.
To Reproduce Steps to reproduce the behavior:
page.11ty.cjs:
If
dynamicPermalink
is true, this error is thrown:If
dynamicPermalink
is false, this error is thrown:It looks like the permalink function is always interpreted as a string, and never called.
Expected behavior The permalink function is called.
Environment: