1,解壓安裝nginx windows版本
2,配置eclipse的external tool configuration
Location,選擇Browse File System,找到nginx.exe
Working Derectory,選擇nginx解壓目錄
Arguments,運行nginx 空,中止nginx -s quit,重啓nginx -s reload
3,將nginx/conf/nginx.conf連接到eclipse,方便編輯配置nginx
配置http,或server,或location
ssi on;
配置默認服務的根
location / {
root E:\sapling\demo\qingbo_design_demo; #設計頁面路徑
index index.html;
}
4,運行nginx,訪問http://localhost/index.html
5,編輯html,並按碎片劃分,按如下方式拼接碎片代碼
<!--#include file="/layout/header.html"-->
6,一級頁面的佈局,
/layout/head.html,引入資源css+js等(必定要是公共的資源)
/laytou/header.html,導航區
/layout/footer.html,尾部
7,二級頁面的佈局和菜單
/user/layout/head.html,二級頁面能夠有本身的特有碎片(引入特有的樣式和腳本),也能夠使用一級頁面的碎片
/user/layout/left.html,二級頁面可能有菜單,甚至是兩級菜單
8,index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="keywords" content="Demo,Index">
<meta name="description" content="Demo HTML design">
<title>index</title>
<!--#include file="/layout/head.html"-->
<!-- 還能夠引入頁面特有的資源和樣式 -->
</head>
<body>
<!--#include file="/layout/header.html"-->
index body content
<br/>
<button onclick="clickme()">Click Me</button>
<!--#include file="/layout/footer.html"-->
</body>
</html>