GoBlog/templates/header.gohtml

25 lines
1.2 KiB
Plaintext
Raw Normal View History

{{ define "header" }}
{{ with .Blog.Announcement }}{{ with .Text }}
<div id="announcement" data-nosnippet>
{{ md . }}
</div>
{{ end }}{{ end }}
<header>
2021-08-04 21:26:38 +00:00
<h1><a href="{{ .Blog.RelativePath "/" }}" rel="home" title="{{ mdtitle .Blog.Title }}" translate="no">{{ mdtitle .Blog.Title }}</a></h1>
2020-10-12 16:47:23 +00:00
{{ with .Blog.Description }}<p><i>{{ . }}</i></p>{{ end }}
2020-11-01 17:37:21 +00:00
<nav>
{{ with index .Blog.Menus "main" }}
2021-08-04 21:26:38 +00:00
{{ range $i, $item := .Items }}{{ if ne $i 0 }} &bull; {{ end }}<a href="{{ $item.Link }}">{{ mdtitle $item.Title }}</a>{{ end }}
2020-11-01 17:37:21 +00:00
{{ end }}
</nav>
2021-02-20 22:35:16 +00:00
{{ if .LoggedIn }}
<nav>
<a href="{{ .Blog.RelativePath "/editor" }}">{{ string .Blog.Lang "editor" }}</a>
2021-02-20 22:35:16 +00:00
&bull; <a href="/notifications">{{ string .Blog.Lang "notifications" }}</a>
{{ if .WebmentionReceivingEnabled }}&bull; <a href="/webmention">{{ string .Blog.Lang "webmentions" }}</a>{{ end }}
{{ if .CommentsEnabled }}&bull; <a href="{{ .Blog.RelativePath "/comment" }}">{{ string .Blog.Lang "comments" }}</a>{{ end }}
&bull; <a href="/logout">{{ string .Blog.Lang "logout" }}</a>
2021-02-20 22:35:16 +00:00
</nav>
{{ end }}
</header>
{{ end }}