Initial commit

This commit is contained in:
paul 2019-05-14 14:11:03 +02:00
commit d2eba2e5a8
32 changed files with 1195 additions and 0 deletions

1
assets/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*_vfsdata.go

32
assets/dev.go Normal file
View file

@ -0,0 +1,32 @@
// +build dev
package assets
import (
"go/build"
"log"
"net/http"
"github.com/shurcooL/httpfs/union"
)
// Assets contains files that will be included in the binary
// this is a union file system, so to reach the expected file
// the root folder defined in the map should be prepended
// to the file path
var Assets = union.New(map[string]http.FileSystem{
"/migrations": http.Dir(importPathToDir("bitmask.me/skeleton/assets/migrations")),
"/templates": http.Dir(importPathToDir("bitmask.me/skeleton/assets/templates")),
"/static": http.Dir(importPathToDir("bitmask.me/skeleton/assets/static")),
})
// importPathToDir is a helper function that resolves the absolute path of
// modules, so they can be used both in dev mode (`-tags="dev"`) or with a
// generated static asset file (`go generate`).
func importPathToDir(importPath string) string {
p, err := build.Import(importPath, "", build.FindOnly)
if err != nil {
log.Fatalln(err)
}
return p.Dir
}

6
assets/doc.go Normal file
View file

@ -0,0 +1,6 @@
//go:generate vfsgendev -source="bitmask.me/skeleton/assets".Assets
// Package assets contains assets for the service, that will be embedded into
// the binary.
// Generate by running `go generate bitmask.me/skeleton/assets`.
package assets

View file

@ -0,0 +1 @@
-- this file is only here so the database can track a completely empty state.

View file

View file

0
assets/static/index.html Normal file
View file

View file

@ -0,0 +1,3 @@
{{ define "smiley" }}
:)
{{- end }}

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Landing Page</title>
</head>
<body>
<h1>Skeleton Project</h1>
If you are an admin, you can <a href="/login">Log in</a>.
</body>
</html>