GoBlog/templates/index.gohtml

42 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-08-05 17:14:10 +00:00
{{ define "title" }}
2020-09-21 16:03:05 +00:00
{{ if .Title }}
2020-10-06 17:07:48 +00:00
<title>{{ .Title }} - {{ (blog .Blog).Title }}</title>
2020-09-21 16:03:05 +00:00
{{ else }}
2020-10-06 17:07:48 +00:00
<title>{{ (blog .Blog).Title }}</title>
2020-09-21 16:03:05 +00:00
{{ end }}
<link rel="alternate"
type="application/rss+xml"
title="RSS"
href="{{ .First }}.rss"/>
<link rel="alternate"
type="application/atom+xml"
title="Atom"
href="{{ .First }}.atom"/>
<link rel="alternate"
type="application/feed+json"
title="JSON Feed"
href="{{ .First }}.json"/>
2020-08-05 17:14:10 +00:00
{{ end }}
{{ define "main" }}
<main>
{{ with .Title }}<h1>{{ . }}</h1>{{ end }}
{{ with .Description }}{{ md . }}{{ end }}
2020-09-02 15:56:18 +00:00
{{ if (or .Title .Description) }}
<hr>
{{ end }}
2020-08-05 17:54:04 +00:00
{{ 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 }}
2020-08-05 17:14:10 +00:00
</main>
{{ end }}
{{ define "index" }}
{{ template "base" . }}
{{ end }}