micrach/templates/index.html
2021-09-05 14:36:10 +03:00

64 lines
2.4 KiB
HTML

<html lang="en">
<head>
{{ template "static" }}
<title>Micrach</title>
<!-- Primary Meta Tags -->
<meta charset="UTF-8"/>
<meta name="title" content="Micrach">
<meta name="description" content="Single board imageboard.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://micrach.igonin.dev/">
<meta property="og:title" content="Micrach">
<meta property="og:description" content="Single board imageboard.">
<meta property="og:image" content="https://memepedia.ru/wp-content/uploads/2018/03/ebanyy-rot-etogo-kazino.png">
<!-- Twitter -->
<meta property="twitter:card" content="https://memepedia.ru/wp-content/uploads/2018/03/ebanyy-rot-etogo-kazino.png">
<meta property="twitter:url" content="https://micrach.igonin.dev/">
<meta property="twitter:title" content="Micrach">
<meta property="twitter:description" content="Single board imageboard.">
<meta property="twitter:image" content="https://memepedia.ru/wp-content/uploads/2018/03/ebanyy-rot-etogo-kazino.png">
</head>
<body>
<h1 class="display-1 text-center">Welcome to Micrach</h1>
<div class="container">
<form class="row row-cols-auto gy-4" action="/" method="POST" enctype="multipart/form-data">
<input class="form-control" id="postTitle" placeholder="Title" name="title">
<textarea class="form-control" id="postText" rows="3" placeholder="Text" name="text"></textarea>
<input class="form-control" type="file" id="formFileMultiple" multiple name="files">
</form>
<div class="row row-cols-auto gy-4">
{{range $Post := .}}
<div class="col col-sm-6 col-md-4 col-lg-3">
<div class="card">
{{ $length := len $Post.Files }} {{ if gt $length 0 }}
{{$FirstFile := index $Post.Files 0}}
<img
src="{{$FirstFile.Name}}"
class="card-img-top"
alt="Uploaded picture"
>
{{end}}
<div class="card-body">
<h5 class="card-title">{{$Post.Title}}</h5>
<p class="card-text">{{$Post.Text}}</p>
<a href="/{{$Post.ID}}" class="btn btn-outline-primary">Open</a>
</div>
</div>
</div>
{{end}}
</div>
</div>
</body>
</html>