hooks.top.where: 'name =~ /^Dailies/' # only works for top level `/Dailies` page
hooks.top.where: 'name =~ /^Dailies\/.+\/.+\/.+$/' # doesn't work
hooks.top.where: 'name =~ /^Dailies\/\d{4}\/\d{2}\/\d{2}$/' # doesn't work
The problem doesn’t seem to be the pattern - hooks.top.where: 'name =~ /^Dailies/' works fine for me as the way to match the pages.
But when it comes to figuring out the date from the page URL, it fails. The code is simplistic, and based on the assumption that ‘the last bit after the slash is the date in string form’. That’s not true in your new case (the code tries to parse ‘29’ as an entire date today).
As a quick (very inelegant) fix you could replace the space-script line:
hooks.top.where: 'name =~ /^Dailies/' # Worked on all levels
hooks.top.where: 'name =~ /^Dailies\/.+\/.+\/.+$/' # Worked on ONLY the "Dailies/<year>/<month>/<day>" pages
hooks.top.where: 'name =~ /^Dailies\/\d{4}\/\d{2}\/\d{2}$/' # Worked on ONLY the "Dailies/<year>/<month>/<day>" pages
I have this widget template:
---
description: test widget
tags: template
hooks.top.where: 'name =~ /^Dailies/'
---
# TEST WIDGET
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
So I think something else may be going on, can you post what you have added for your widget template and space-scripts to see if there is anything in the modifications you would have had to make to @OpinionatedGeek’s templates/scripts that may be causing issues?