Initial commit

This commit is contained in:
2019-03-05 00:07:59 +09:00
commit e5d13f19ad
14 changed files with 15042 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package main
import (
"log"
"net/http"
"github.com/shurcooL/vfsgen"
)
func main() {
var err error
templateFiles := http.Dir("assets/template")
err = vfsgen.Generate(templateFiles, vfsgen.Options{
Filename: "assets/template/template_vfsdata.go",
PackageName: "template",
VariableName: "Template",
})
if err != nil {
log.Fatalln("Unable to generate templates: ", err)
}
staticFiles := http.Dir("assets/static")
err = vfsgen.Generate(staticFiles, vfsgen.Options{
Filename: "assets/static/static_vfsdata.go",
PackageName: "static",
VariableName: "Static",
})
if err != nil {
log.Fatalln("Unable to generate static files: ", err)
}
}
+10038
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+4435
View File
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome!</title>
<link href="/static/css/bootstrap.css" rel=stylesheet>
</head>
<body>
<div class="container">
<div class="row">
<img src="/static/img/profile.jpg" alt="profile-picture" class="rounded">
<h1>Photlog</h1>
</div>
<div class="row">
<div class="col text-center">
<img src="/media/{{.Media}}" alt="{{.Title}}" class="rounded">
</div>
<div class="col">
<h3 class="text-center">{{.Title}}</h3>
<h5 class="text-center">{{.Subtitle}}</h5>
<p>{{.Description}}.</p>
</div>
</div>
</div>
<script src="/static/js/bootstrap.js"></script>
</body>
</html>
+36
View File
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Post Content</title>
<link href="/static/css/bootstrap.css" rel=stylesheet>
</head>
<body>
<div class="container">
<div class="row">
<form enctype="multipart/form-data" method="POST" action="/post/">
<div class="form-group">
<label for="title">Title</label>
<input type="text" class="form-control" name="title" placeholder="Title">
</div>
<div class="form-group">
<label for="subtitle">Subtitle</label>
<input type="text" class="form-control" name="subtitle" placeholder="Subtitle">
</div>
<div class="form-group">
<label for="description">Description</label>
<input type="text" class="form-control" name="description" placeholder="Description">
</div>
<div class="form-group">
<label for="media">Media</label>
<input type="file" class="form-control-file" name="media">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
<script src="/static/js/bootstrap.js"></script>
</body>
</html>