所以我有一个网站,它的结构由各种模板组成:
- index //the html skeleton, with script tags and css links
- header //the header of the page
- topnavigation //contains the main nav with the menu
- content //this is where the dynamic content will be changed for different pages
- footer //the footer
现在,我知道整合它的唯一方法是:
res.render(content);
content -> inherits footer
footer -> inherits topnavigation
topnavigation-> inherits header
header -> inherits index
我认为如果我能有类似的东西,它会更加实用和易于维护:
res.render(content);
content -> inherits dochead
index -> includes header + topnnavigation + footer
- 我错了吗?
- 如果我是对的,我该怎么做?
谢谢