- Node.js 6.x Blueprints
- Fernando Monteiro
- 107字
- 2021-07-14 10:35:05
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:

Folder structure
推薦閱讀
- Linux C/C++服務(wù)器開(kāi)發(fā)實(shí)踐
- SQL for Data Analytics
- Android 7編程入門經(jīng)典:使用Android Studio 2(第4版)
- Eclipse Plug-in Development:Beginner's Guide(Second Edition)
- 嚴(yán)密系統(tǒng)設(shè)計(jì):方法、趨勢(shì)與挑戰(zhàn)
- The DevOps 2.5 Toolkit
- 0 bug:C/C++商用工程之道
- Visualforce Developer’s guide
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- Kubernetes源碼剖析
- 人工智能算法(卷1):基礎(chǔ)算法
- 3ds Max 2018從入門到精通
- Learning WordPress REST API
- Zend Framework 2 Cookbook
- Unreal Engine Game Development Cookbook