When using the node.html.twig
or a child of that template, you will have access to the node
variable, which is a limited implementation of the node
object.
From the comments for the classy theme node.html.twig
file:
* - node: The node entity with limited access to object properties and methods.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - node.getCreatedTime() will return the node creation timestamp.
* - node.hasField('field_example') returns TRUE if the node bundle includes
* field_example. (This does not indicate the presence of a value in this
* field.)
* - node.isPublished() will return whether the node is published or not.
As is described in that comment, the value of the node title without any markup can be accessed in twig by using:
{{ node.label }}
.