At the top of a page template, the context (the dot) is a Page object. Inside of the with block, the context is bound to the value passed to the with statement.
With this contrived example:
Hugo will throw an error:
can't evaluate field Title in type int
The error occurs because we are trying to use the .Title method on an integer instead of a Page object. Inside of the with block, if we want to render the page title, we need to get the context passed into the template.
This template will render the page title as desired: