GoBlog/templates/index.gohtml

38 lines
969 B
Plaintext

{{ define "title" }}
<title>{{ blog.Title }}</title>
<link rel="alternate"
type="application/rss+xml"
title="RSS"
href="{{ .First }}?feed=rss"/>
<link rel="alternate"
type="application/atom+xml"
title="Atom"
href="{{ .First }}?feed=atom"/>
<link rel="alternate"
type="application/feed+json"
title="JSON Feed"
href="{{ .First }}?feed=json"/>
{{ end }}
{{ define "main" }}
<main>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Description }}{{ md . }}{{ end }}
{{ if (or .Title .Description) }}
<hr>
{{ end }}
{{ range $i, $post := .Posts }}
{{ include "summary" . }}
{{ end }}
{{ if .HasPrev }}
<p><a href="{{ .Prev }}">Prev</a></p>
{{ end }}
{{ if .HasNext }}
<p><a href="{{ .Next }}">Next</a></p>
{{ end }}
</main>
{{ end }}
{{ define "index" }}
{{ template "base" . }}
{{ end }}