you can't do that because when you make a request the server get the required file the does the logic on it and then it send it back to the browser .
so when you use this
app.get('/', function(req, res) {
const year = date.getYear();
res.render('home', {copyrightYear: year})
});
the server will get the home file which includes the partials files then pass the data then send it to the browser .
so you must make separate request for each file you want and then do the logic on it
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…