apps/posts/templates/index.html 1.1 K raw
1
{{define "index.html"}}{{template "base.html" .}}{{end}}
2
{{define "title"}}{{.BlogTitle}}{{end}}
3
{{define "meta"}}
4
  <meta name="description" content="{{.BlogDescription}}">
5
  <meta property="og:title" content="{{.BlogTitle}}">
6
  <meta property="og:description" content="{{.BlogDescription}}">
7
  <meta property="og:type" content="website">
8
  <meta property="og:url" content="{{.SiteURL}}">
9
  {{if .OGImageURL}}
10
    <meta property="og:image" content="{{.OGImageURL}}">
11
  {{else}}
12
    <meta property="og:image" content="{{.SiteURL}}/static/og.png">
13
  {{end}}
14
{{end}}
15
{{define "content"}}
16
  {{if .IntroHTML}}
17
    <article class="intro markdown-body">
18
      {{.IntroHTML}}
19
    </article>
20
  {{end}}
21
  {{if not .Posts}}
22
    <p class="empty">no posts yet</p>
23
  {{end}}
24
  <div class="post-list">
25
    {{range .Posts}}
26
      <a href="/posts/{{.Slug}}" class="post-item">
27
        <div class="post-item-info">
28
          <span class="post-title">{{.DisplayTitle}}</span>
29
        </div>
30
        {{if .PublishedDate}}
31
          <time class="post-date">{{.PublishedDateStr}}</time>
32
        {{end}}
33
      </a>
34
    {{end}}
35
  </div>
36
{{end}}