- 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
推薦閱讀
- Mastering AWS Lambda
- CockroachDB權威指南
- Linux C/C++服務器開發實踐
- PHP程序設計(慕課版)
- Python進階編程:編寫更高效、優雅的Python代碼
- SAP BusinessObjects Dashboards 4.1 Cookbook
- Angular開發入門與實戰
- Android Wear Projects
- App Inventor創意趣味編程進階
- JBoss:Developer's Guide
- SQL Server 2008 R2數據庫技術及應用(第3版)
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Learning Splunk Web Framework
- 大數據時代的企業升級之道(全3冊)
- 實驗編程:PsychoPy從入門到精通