How to Create Reusable head.html Using ejs

  node.js, question

The function I want to achieve is to build a reusable head.html that can be shared by multiple pages.

I’ll post the code snippet.
In expres

res.render(rank.html, {basePath:  "http://127.0.0.1:3000"})

Rank.html page

< percentage-include (
 "../common/head.html",
 bracket
 css: ["/module/issue/rank/css.js"]
 })
 Percentage >

Head.html was quoted.

In head.html

< percentage # function sets the href percentage of css files >
 < percentage function linkCss( cssHref) {percentage >
 < link rel="stylesheet" href= < percentage = cssHref percentage > >
 < percentage} percentage >

< percentage # add css percentage >
 < percentage linkCss("/public/css/style.css ") percentage >
 < percentage # add css from include percentage >
 < percentage css.map(linkCss) percentage >

Finally hope to output “http://127.0.0.1:3000/module/issue/rank/css.js.
But I don’t know what to do.

Or is there any other way to solve this problem?

Css I wrote in layout file.
It includes header and footer parts. The ejs engine used for the template is only in html file format.
Look.
https://github.com/luoyjx/gaoqi-blog/blob/master/views/layout.html