Render pinned post on index template

This commit is contained in:
2021-12-03 04:15:35 +01:00
parent 823adde655
commit 58c55e4659
3 changed files with 34 additions and 0 deletions
+9
View File
@@ -13,6 +13,15 @@
{{ template "menu.go.tmpl" . }}
</div>
<!-- render pinned -->
<div class="pinned-container">
{{ range .Pinned }}
<div class="pinned-post">
{{ template "post.go.tmpl" . }}
</div>
{{ end }}
</div>
</section>
</body>
+24
View File
@@ -0,0 +1,24 @@
<div class="blog-post">
<!-- render post header -->
<div class="blog-post-head">
<h1>{{ .Title }}</h1>
</div>
{{ if .FImage }}
<div class="blog-post-head-image">
<img src="{{ .FImage }}"></img>
</div>
{{ end }}
<!-- render post -->
<div class="blog-post-content">
{{ .HTML }}
</div>
<!-- render post tailer -->
<div class="blog-post-tailer">
<h3>… … …</h3>
</div>
</div>
+1
View File
@@ -17,6 +17,7 @@ import (
//go:embed head.go.tmpl
//go:embed index.go.tmpl
//go:embed menu.go.tmpl
//go:embed post.go.tmpl
var content embed.FS
// List of compiled go-templates