-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmpl.go
42 lines (40 loc) · 1.19 KB
/
tmpl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
const tmplDir string = `<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>{{.title}}</title>
<head>
<body>
<h1>{{.title}}</h1>
{{range .links}} <p> {{.N}} {{.Typ}} <a href="{{$.title}}/{{.Name}}">{{.Name}}</a></p>{{end}}
</body>
</html>
`
const tmplUpload = `<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>上传文件</title>
</head>
<body>
<form enctype="multipart/form-data" method="post" action="/upload">
<input type="file" name="uploadfile" multiple="multiple" />
<input type="submit" name="button1" value="上传">
</form>
<h2>上传列表</h2>
<pre><code>
{{range .}}上传: {{.}}
{{end}}
</code></pre>
</body>
</html>`
const mainPage = `<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>分享和上传文件</title>
</head>
<body>
<h2><a href="/share/">浏览文件</a></h2>
<h2><a href="/upload">上传文件</a></h2>
</body>
</html>`