GoBlog/templates/post.gohtml

46 lines
1.7 KiB
Plaintext

{{ define "title" }}
<title>{{ with .Data.RenderedTitle }}{{ . }} - {{end}}{{ mdtitle .Blog.Title }}</title>
{{ include "postheadmeta" . }}
{{ with shorturl .Data }}<link rel="shortlink" href="{{ . }}">{{ end }}
{{ end }}
{{ define "main" }}
<main class=h-entry>
<article>
<data class="u-url hide" value="{{ absolute .Data.Path }}"></data>
{{ with .Data.RenderedTitle }}<h1 class=p-name>{{ . }}</h1>{{ end }}
{{ include "postmeta" . }}
{{ include "postactions" . }}
{{ if .Data.Content }}
{{ include "oldcontentwarning" . }}
<div class=e-content>
{{ content .Data false }}
</div>
{{ end }}
{{ include "posttax" . }}
</article>
{{ include "author" . }}
</main>
{{ if .LoggedIn }}
<div id="posteditactions" class="p">
<form class="in" method="post" action="{{ .Blog.RelativePath "/editor" }}#update">
<input type="hidden" name="editoraction" value="loadupdate">
<input type="hidden" name="url" value="{{ .Canonical }}">
<input type="submit" value="{{ string .Blog.Lang "update" }}">
</form>
<form class="in" method="post" action="{{ .Blog.RelativePath "/editor" }}">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="url" value="{{ .Canonical }}">
<input type="submit" value="{{ string .Blog.Lang "delete" }}" class="confirm" data-confirmmessage="{{ string .Blog.Lang "confirmdelete" }}">
</form>
<script defer src="{{ asset "js/formconfirm.js" }}"></script>
</div>
{{ end }}
{{ if .CommentsEnabled }}
{{ include "interactions" . }}
{{ end }}
{{ end }}
{{ define "post" }}
{{ template "base" . }}
{{ end }}