For example, a post at /work/code/_posts/2008-12-24-closures.md
would have this field set to ['work', 'code']
But I have tried it in Jekyll 4.0.0 and it does not work, when you put pages under subdirectories, they are not assigned a category based in their path.
Only when you declare categories in the Front Matter it seems to correctly assign categories to pages.
Notice that the example uses _posts in the path string?
Categories based on a path are only for posts not for regular pages.
The documentation section uses the title Page Variables because inside a template (layout or include), the current page / document being procesed is always referenced by the name page
That means even inside the post source file _posts/2019-11-12-hello.md, you would use page.title to render the Post’s title.