Initial commit
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Vendored
+10038
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Vendored
+4435
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user