You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the context of a #compile (or #route or #preprocess) block, it is tricky to get hold of the path of the item currently being compiled, because in Nanoc 4.1, the path could be assigned afterwards, e.g. when using the new #write method:
In this example, you’d be using the path before it’s even known.
This is not a new problem—the fact that the #path method is accessible on an item in Nanoc 4.0 is a bug. Using it this way will likely trip up the dependency tracker, causing items to be unnecessarily recompiled, or not recompiled when they should be.
I’m working on a fix which will make #path (and related methods, such as #compiled_content, which makes even less sense in a compilation rule) inaccessible, i.e. raise a NoMethodError.
In the mean time, the recommended approach would be to pass the item in its entirely to the :more_filter filter:
I'm getting a compile error when upgrading from 4.0.0 to 4.1.0rc:
The rule looks like this:
It seems to be the
item.path
triggering the problem. Is this something that isn't allowed anymore?The text was updated successfully, but these errors were encountered: