I have three different view files,
// view1.ejs file
<span>view1</span>
// view2.ejs file
<span>view2</span>
// view3.ejs file
<span>view3</span>
and I want each of them to include common.ejs file respectively.
// common.ejs
<div class="beginning">
<div>
<span>something</span>
</div>
</div>
<div class="end">
<div>
<span>something</span>
</div>
</div>
But the problem is that, I want to include common.ejs file like the way below,
// view1.ejs file
<div class="beginning">
<div>
<span>something</span>
</div>
</div>
<span>view1</span> // if the case of view2.ejs, <span>view2</span>
<div class="end">
<div>
<span>something</span>
</div>
</div>
In other words, I want to firstly divide a common.ejs file into pieces, then put(include) them in the way I like.
If I have ten view files, it would be a lot waste of code, copy and paste.
Is there any way to do that?
Any advice would be appreciated. Thanks!