embed static files now (#14)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Co-authored-by: sneak <sneak@sneak.berlin> Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
140
templates/index.html
Normal file
140
templates/index.html
Normal file
@@ -0,0 +1,140 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Changeme: Go HTTP Server Boilerplate</title>
|
||||
<link rel="stylesheet" href="/s/css/bootstrap-4.5.3.min.css" />
|
||||
<link rel="stylesheet" href="/s/css/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||
<a class="navbar-brand" href="#">Quickstart</a>
|
||||
<button
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#navbarsExampleDefault"
|
||||
aria-controls="navbarsExampleDefault"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#"
|
||||
>Home <span class="sr-only">(current)</span></a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link disabled"
|
||||
href="#"
|
||||
tabindex="-1"
|
||||
aria-disabled="true"
|
||||
>Disabled</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="dropdown01"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
>Dropdown</a
|
||||
>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdown01">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<input
|
||||
class="form-control mr-sm-2"
|
||||
type="text"
|
||||
placeholder="Search"
|
||||
aria-label="Search"
|
||||
/>
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">
|
||||
Search
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main role="main">
|
||||
<div class="jumbotron">
|
||||
<div class="container">
|
||||
<h1 class="display-3">Hello, world!</h1>
|
||||
<p>
|
||||
This is a boilerplate application for you to use as a base for your
|
||||
own sites and services.
|
||||
</p>
|
||||
<p>
|
||||
<a class="btn btn-primary btn-lg" href="#" role="button"
|
||||
>Learn more »</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- Example row of columns -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h2>Batteries Included</h2>
|
||||
<p>
|
||||
This includes a router, bundling of static assets, and example
|
||||
handlers.
|
||||
</p>
|
||||
<p>
|
||||
<a class="btn btn-secondary" href="#" role="button"
|
||||
>View details »</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Best Practices</h2>
|
||||
<p>
|
||||
This template repo follows best practices from experienced
|
||||
application developers.
|
||||
</p>
|
||||
<p>
|
||||
<a class="btn btn-secondary" href="#" role="button"
|
||||
>View details »</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2>Easy To Use</h2>
|
||||
<p>This repo builds under Docker and is ready to go.</p>
|
||||
<p>
|
||||
<a class="btn btn-secondary" href="#" role="button"
|
||||
>View details »</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
<!-- /container -->
|
||||
</main>
|
||||
|
||||
<footer class="container">
|
||||
<p>© No rights reserved - This is in the public domain!</p>
|
||||
</footer>
|
||||
<script src="/s/js/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="/s/js/bootstrap-4.5.3.bundle.min.js"></script>
|
||||
<script src="/s/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
128
templates/login.html
Normal file
128
templates/login.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Changeme: Go HTTP Server Boilerplate</title>
|
||||
<link rel="stylesheet" href="/s/css/bootstrap-4.5.3.min.css" />
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding-top: 3.5rem;
|
||||
}
|
||||
|
||||
.bd-placeholder-img {
|
||||
font-size: 1.125rem;
|
||||
text-anchor: middle;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.bd-placeholder-img-lg {
|
||||
font-size: 3.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||
<a class="navbar-brand" href="#">Quickstart</a>
|
||||
<button
|
||||
class="navbar-toggler"
|
||||
type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#navbarsExampleDefault"
|
||||
aria-controls="navbarsExampleDefault"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#"
|
||||
>Home <span class="sr-only">(current)</span></a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link disabled"
|
||||
href="#"
|
||||
tabindex="-1"
|
||||
aria-disabled="true"
|
||||
>Disabled</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="dropdown01"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
>Dropdown</a
|
||||
>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdown01">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-lg-0">
|
||||
<input
|
||||
class="form-control mr-sm-2"
|
||||
type="text"
|
||||
placeholder="Search"
|
||||
aria-label="Search"
|
||||
/>
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">
|
||||
Search
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main role="main">
|
||||
|
||||
|
||||
<div class="login-form">
|
||||
<form action="/login" method="post">
|
||||
<h2 class="text-center">Log in</h2>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Username" required="required">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" placeholder="Password" required="required">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-block">Log in</button>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label class="float-left form-check-label"><input type="checkbox"> Remember me</label>
|
||||
<a href="#" class="float-right">Forgot Password?</a>
|
||||
</div>
|
||||
</form>
|
||||
<p class="text-center"><a href="#">Create an Account</a></p>
|
||||
</div>
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
<footer class="container">
|
||||
<p>© No rights reserved - This is in the public domain!</p>
|
||||
</footer>
|
||||
<script src="/s/js/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="/s/js/bootstrap-4.5.3.bundle.min.js"></script>
|
||||
<script src="/s/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
19
templates/templates.go
Normal file
19
templates/templates.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package templates
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//go:embed *.html
|
||||
var Templates embed.FS
|
||||
|
||||
func MustString(filename string) string {
|
||||
bytes, error := Templates.ReadFile(filename)
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
var out strings.Builder
|
||||
out.Write(bytes)
|
||||
return out.String()
|
||||
}
|
||||
Reference in New Issue
Block a user