G
G
game8022017-01-15 05:10:16
Pug
game802, 2017-01-15 05:10:16

What is extends in Pug (Jade)?

Good afternoon dear experts.
Faced with not understanding what extendsPug (former Jade) is in the html preprocessor
Could you explain to me what it is for and where is the best way to use it? Thanks a lot for any clarification!
PS includeI figured it out completely, but I extendsstill don’t understand the essence

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akzhan, 2017-01-15
@game802

described normally in https://pugjs.org/language/extends.html
extends describes a template (ancestor or layout) and the output will be wrapped in this base template, while the current template can replace any blocks in the ancestor template.
Template inheritance can be any depth.
It's usually useful to create a template for different elements and refine it for some types of them.
Well, for the introduction of layouts (layouts).
Just think of it as inheritance, where the child can override the ancestor's blocks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question