It appears that two things are happening.
- My filter was wrong, the
file
part was unneeded - The dashes are not compatible with dot notation
Try swapping it out for the following:
var p = dv.pages('"' + opt + '"').where(p => p["week-n"] && p.file.year);
Additionally, swap out anywhere that references p.file.week-n
with p["week-n"]
Alternatively you could change the metadata to be weekn
instead, which may be more future proof anyways