2021-09-05 00:36:55 +03:00
|
|
|
{{$FirstPost:= index . 0}}
|
|
|
|
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2021-09-05 15:38:08 +03:00
|
|
|
{{ template "static" }}
|
|
|
|
{{ template "meta" $FirstPost }}
|
2021-09-05 00:36:55 +03:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<h1 class="display-1 text-center">Welcome to Micrach</h1>
|
|
|
|
|
|
|
|
<div class="container">
|
2021-09-08 22:34:10 +03:00
|
|
|
{{ template "post-form" $FirstPost.ID }}
|
2021-09-05 00:36:55 +03:00
|
|
|
|
2021-09-10 19:21:33 +03:00
|
|
|
<div class="row row-cols-auto gy-4 mb-4">
|
2021-09-05 00:36:55 +03:00
|
|
|
{{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
|
2021-09-10 19:16:53 +03:00
|
|
|
src="/uploads/{{$Post.ID}}/{{$FirstFile.Name}}"
|
2021-09-05 00:36:55 +03:00
|
|
|
class="card-img-top"
|
|
|
|
alt="Uploaded picture"
|
|
|
|
>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
<div class="card-body">
|
2021-09-10 19:16:53 +03:00
|
|
|
{{ if ne $Post.Title "" }}
|
2021-09-05 00:36:55 +03:00
|
|
|
<h5 class="card-title">{{$Post.Title}}</h5>
|
2021-09-10 19:16:53 +03:00
|
|
|
{{ end }}
|
2021-09-05 00:36:55 +03:00
|
|
|
<p class="card-text">{{$Post.Text}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|