With both of these commands I can use code from another file. As I see it when we use extends file.jade
we can use block
, to change blocks in file.jade
before the compilation. But is it the only difference and am I right?
Thank you.
Well, as @laggingreflex wrote above, there are docs on these commands: extends and include.
Extra points: you can use include
for different files, not only for jade files. Also, you can use include
multiple times on the page. This command just includes content of the different file, straight into the place. You may think of it, as if you make a big Lego project by using (including) different small pieces.
Extends
on the contrary takes big Lego project and substitutes marked blocks with your pieces with special block
command. It could be used once and overwrite content of the destination file (file with the extends
command).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With