I have no idea how to draw the structure of my project here in stackoverflow, so I will try to explain what my issues are as clear as possible.
I have server.js file in my root, using express.static middleware.
app.use(express.static(path.join(__dirname, 'public')));
and my style.css file is included in public/css/style.css
Also, I am using ejs view engine, and I have two view files. (ejs view engine is looking for views folder)
First one is views/main/home.ejs, and second one is views/sub/intro/location.ejs
I`m using <% include %> code in each file,
// views/main/home.ejs
<% include ../header.ejs %>
// views/sub/intro/location.ejs
<% include ../../header.ejs %>
The problem is that, in header.ejs file, do I have to link same css file in two different href path? like,
// views/header.ejs
// for views/main/home.ejs
<link rel="stylesheet" href="css/style.css" type="text/css">
// for views/sub/intro/location.ejs
<link rel="stylesheet" href="../css/style.css" type="text/css">
Is that the only way I can do?
if header.ejs has many static image files, do I have to write
img src
twice for each image?
If there is more efficient way to solve this issue, it would be really appreciated to remind me of that. thank you.