![Node.js 6.x Blueprints](https://wfqqreader-1252317822.image.myqcloud.com/cover/996/36701996/b_36701996.jpg)
上QQ阅读APP看书,第一时间看更新
Adding partials files for head and footer
Now lets add files for head and footer:
- Inside the
views/partials
folder create a new file calledhead.html
and place the following code:<meta charset="utf-8"> <title>{{ title }}</title> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs /twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css'> <link rel="stylesheet" href="/stylesheets/style.css">
- Inside the
views/partials
folder create a file calledfooter.html
and place the following code:<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1 /jquery.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap /4.0.0-alpha.2/js/bootstrap.min.js'></script>
- Now, its time to add the partials file to the
layout.html
page using theinclude
tag. Openlayout.html
and add the following code:<!DOCTYPE html> <html> <head> {% include "../partials/head.html" %} </head> <body> {% block content %} {% endblock %} {% include "../partials/footer.html" %} </body> </html>
Finally we are ready to continue with our project. This time our directories structure will look like the following screenshot:
![](https://epubservercos.yuewen.com/3064D2/19470418708015106/epubprivate/OEBPS/Images/image_02_002.jpg?sign=1739207519-FcH5nqIaldxYbHgVx3bhFtRWSPPgyqx6-0-61debdb98fbab7e6ab9c6c1c5893343f)
Folder structure