mirror of
https://github.com/jlelse/GoBlog
synced 2024-06-02 04:54:28 +00:00
36 lines
1.4 KiB
Plaintext
36 lines
1.4 KiB
Plaintext
{{ define "title" }}
|
|
<title>{{ with .Data.Title }}{{ . }} - {{ end }}{{ .Blog.Title }}</title>
|
|
<link rel="alternate" type="application/rss+xml" title="RSS{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.rss"/>
|
|
<link rel="alternate" type="application/atom+xml" title="Atom{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.atom"/>
|
|
<link rel="alternate" type="application/feed+json" title="JSON Feed{{ with .Data.Title }} ({{ . }}){{ end }}" href="{{ .Data.First }}.json"/>
|
|
{{ end }}
|
|
|
|
{{ define "main" }}
|
|
<main class="h-feed">
|
|
{{ with .Data.Title }}<h1 class="p-name">{{ . }}</h1>{{ end }}
|
|
{{ with .Data.Description }}{{ md . }}{{ end }}
|
|
{{ if (or .Data.Title .Data.Description) }}
|
|
<hr>
|
|
{{ end }}
|
|
{{ $blog := .Blog }}
|
|
{{ if .Data.Posts }}
|
|
{{ $summaryTemplate := .Data.SummaryTemplate }}
|
|
{{ range $i, $post := .Data.Posts }}
|
|
{{ include $summaryTemplate $blog $post }}
|
|
{{ end }}
|
|
{{ else }}
|
|
<p>{{ string .Blog.Lang "noposts" }}</p>
|
|
{{ end }}
|
|
{{ if .Data.HasPrev }}
|
|
<p><a href="{{ .Data.Prev }}">{{ string .Blog.Lang "prev" }}</a></p>
|
|
{{ end }}
|
|
{{ if .Data.HasNext }}
|
|
<p><a href="{{ .Data.Next }}">{{ string .Blog.Lang "next" }}</a></p>
|
|
{{ end }}
|
|
{{ include "author" . }}
|
|
</main>
|
|
{{ end }}
|
|
|
|
{{ define "index" }}
|
|
{{ template "base" . }}
|
|
{{ end }} |