Node Front End Template Engine Usage Problem

  node.js, question

In order tojadeFor example
Display user information usage at the front end
Welcome back, #{}
At this time, the node server needs to pass the data when rendering the template.
That is,return res.render('/home', {user: user});
This seems to be no problem.
But in realityWelcome back, #{}Such templates containing current user information are generally written inlayout.jade
Then do I have to add user data when rendering each page
return res.render('/XXXX', {user: user, XXXX:XXXX});

It may be considered touserIn a common context, the samesessionCan be requested touserInformation, so that you can inlayout.jadeDirectly referenced in the template.

expressIt is mentioned in the document
I found relevant answers in stackoverflow. …

app.localsThe defined variables can be retrieved throughout the application