diff --git a/README.md b/README.md index 40aa615..196c9fc 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,9 @@ This object has a fields like `dir.pages`, which is a list of all the pages (a l Title -The title is either the title YAML field, or if that isn't defined, the .realName of the file, which is the adjusted name of the file without its extension and a date prefix (if present) removed. The title isn't properly available to Python inside the page itself, or from __config__.py, since the page has not been processed when these are executed. If .page is accessed from these (the page or config), or if a title was never defined in the page, then the .realName of the file would be returned. +The title is accessed with page.title. It is picked up either from PyPage code in the page or a title YAML field in the file. If `title` is not defined by the page, then page.realName of the file is used, which is the adjusted name of the file without its extension and idea date prefix (if present) removed. The title isn't properly available to Python inside the page itself, or from __config__.py, since the page has not been processed when these are executed. If page.title is accessed from these (the page or config), or if a title was never defined in the page, then the .realName of the file would be returned. + +Note: the title can directly be accessed as `title` (without `pageObj.title`) in the template (and [inherited](https://github.com/arjun-menon/pypage?tab=readme-ov-file#inheritance-with-inject-and-exists) templates) for the page, since all environment variables from the page are passed on to the template, during template processing. ❌✅❌✅