Skip to content

Commit 24dcbbe

Browse files
committed
pug模板引擎
1 parent 0196fdf commit 24dcbbe

1,718 files changed

Lines changed: 185442 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Pug/Pug模板引擎.txt

Whitespace-only changes.

Pug/imoocPug/data.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"id":"001",
3+
"name":"zhangsan",
4+
"gender":""
5+
}

Pug/imoocPug/sync.pug

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
doctype html
2+
html
3+
head
4+
meta(charst="utf-8")
5+
title 学习pug
6+
body
7+
h1.className#idName 一级标题1
8+
h2 二级标题
9+
h3 三级标题
10+
h4 四级标题
11+
h5 五级标题
12+
a(href="http://www.baidu.com") 百度
13+
input(type="text",value="姓名")
14+
input(type="radio",checked)
15+
input(type="checkbox",checked)
16+
p 1.a 2.b 3.c 4.d
17+
h1 在文本中写html标签
18+
p
19+
| 1.a
20+
strong 粗体字
21+
| 2.b
22+
| 3.c
23+
| 4.d
24+
span 标签
25+
p.
26+
1.a<strong>粗体字</strong>
27+
2.b
28+
3.c
29+
4.d <span标签</span>
30+
h1 注释
31+
// h1 注释(会编译到html文档中)
32+
//- h2 注释(不会编译大html文档中)
33+
// 块级注释,让//作为要注释代码块的父元素
34+
h2 变量声明
35+
- var course="jade"
36+
h1 #{course}
37+
table
38+
th
39+
td 编号
40+
td 姓名
41+
td 性别
42+
tr
43+
td #{id}
44+
td #{name}
45+
td=gender
46+
- var data="text"
47+
- var htmlData="<script>alert(1);</script><span>script</span>;
48+
p #{data}
49+
p !{htmlData}
50+
p \#{输出花括号}
51+
52+
53+
54+
55+
56+

Pug/imoocPug/varable.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>循环和条件分支</title>
6+
<style>*{color:read}</style>
7+
</head>
8+
<body>
9+
<h1>for循环,遍历对象,支持js原生写法</h1>
10+
<p>1</p>
11+
<p>zhangsan</p>
12+
<p>nan</p>
13+
<h1>each循环,可以理解为pug特殊的标签</h1>
14+
<p>value:1</p>
15+
<p>Key:id</p>
16+
<p>value:zhangsan</p>
17+
<p>Key:name</p>
18+
<p>value:nan</p>
19+
<p>Key:gender</p>
20+
<h1>each的数组遍历</h1>
21+
<ul></ul>
22+
<li>英语</li>
23+
<li>语文</li>
24+
<li>数学</li>
25+
<h1>each嵌套循环</h1>
26+
<ul></ul>
27+
<li>001</li>
28+
<li>张三</li>
29+
<ul></ul>
30+
<li>10</li>
31+
<li>20</li>
32+
<li>30</li>
33+
<li>002</li>
34+
<li>李四</li>
35+
<ul></ul>
36+
<li>30</li>
37+
<li>40</li>
38+
<li>50</li>
39+
<h1>if/else的使用</h1>
40+
</body>
41+
</html>

Pug/imoocPug/varable.pug

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
doctype html
2+
html
3+
head
4+
meta(charset="utf-8")
5+
title 循环和条件分支
6+
style.
7+
*{color:read}
8+
body
9+
h1 for循环,遍历对象,支持js原生写法
10+
- var obj={id:001,name:"zhangsan",gender:"nan"}
11+
- for(var x in obj)
12+
p= obj[x]
13+
h1 each循环,可以理解为pug特殊的标签
14+
each value,key in obj
15+
p value:#{value}
16+
p Key:#{key}
17+
h1 each的数组遍历
18+
- var course=["英语","语文","数学"]
19+
ul
20+
each item in course
21+
li= item
22+
h1 each嵌套循环
23+
- var userList=[{id:"001",name:"张三",courses:[10,20,30]},{id:"002",name:"李四",courses:[30,40,50]}]
24+
ul
25+
each x in userList
26+
li= x.id
27+
li= x.name
28+
ul
29+
each y in x.courses
30+
li= y
31+
h1 if/else的使用
32+
33+
34+

Pug/node_modules/.bin/acorn

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pug/node_modules/.bin/acorn.cmd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pug/node_modules/.bin/cleancss

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pug/node_modules/.bin/cleancss.cmd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pug/node_modules/.bin/uglifyjs

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)