~dricottone/blog

ref: 360e020f286673ef32cd7a32f4454f4b46a5fd5c blog/layouts/index.html -rw-r--r-- 701 bytes
360e020fDominic Ricottone Simple HTML sanitization 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{{ define "main" }}
<div>
  {{ .Content }}
</div>

<hr />
<h2>Blog</h2>
<p>These are my three most recent blog posts. More posts can be found on the 'Blog' tab.<p>

<ul id="list-posts">
  {{ with .Site.GetPage "/posts" }}
    {{ range first 3 .Pages }}
    <li>
      <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
      <div class="post">
        <p><i>posted on {{ .Date.Format "2006-01-02" }}</i></p> <!-- see https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference -->
        <p>{{ .Summary }}</p>
        {{ if .Truncated }} <p class="read-more"><a href="{{ .Permalink }}">Read More...</a></p> {{ end }}
      </div>
    </li>
    {{ end }}
  {{ end }}
</ul>
{{ end }}