
This can be especially useful in combination with nested blocks, for complex cases. You can have multiple levels of inheritance - any template you are inheriting from can itself inherit from another template.This can be useful for more complex layout variations. You can nest multiple blocks with different names.

You can decide to override any of them from a template, all of them, or none at all. You can have an unlimited number of blocks with different names - for example, the one in our example is called content.If you don't override a block, it will simply contain either the default content from the base template (if any is specified), or no content at all (if not). Note that you never render layout.pug directly - you still render the page layouts themselves, and they just inherit from the base template. You define a block in the base template - optionally with default content, as we've done here - and then each template that "extends" (inherits from) that base template can override such blocks. Typical examples include ES6 template strings, or this example in Pug: Hello # ) Text interpolation / String interpolation: The insertion of variable values into a string of some kind.

These templaters offer a more limited feature set, but are more widely usable.

#Pug template express how to
