What are the layouts in the Node.js Express library?

I will disable this function because I do not know what it is:

app.set('view options', { layout: false }); 

But it sounds interesting, so I would like to know why it was designed, so I would like to know what use cases and why it is good :)

+6
source share
1 answer

If you read the View Rendering section, it tells you about layouts.

This is a way to apply generic HTML wrappers to all of your pages.

For example Link

 !!! 5 html head title Blog link(rel='stylesheet', href=base + '/style.css') body #container!= body 

It is a layout for an example from the express folder. This will apply to all pages and your actual view that your rendering will display in != body

+6
source

Source: https://habr.com/ru/post/891203/


All Articles