summaryrefslogtreecommitdiff
path: root/feed.xml.tmpl
blob: 89524374428b6e796e139d8d7d73094fadfb33b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>tjp.lol</title>
  <subtitle>Notes, code, and longer thoughts from an elder-millennial software engineer in Salt Lake City.</subtitle>
  <link href="https://tjp.lol/feed.xml" rel="self"/>
  <link href="https://tjp.lol/"/>
  {{$posts := sortPages (index .Pages "weblog") "post_date" "mod_time" -}}
  {{with slicePages $posts 0 1 -}}
  <updated>
    {{- range . -}}
      {{$post_date := or (index .Meta "post_date") .ModTime -}}
      {{rfc3339 $post_date}}
    {{- end -}}
  </updated>
  {{- else -}}
  <updated>2026-07-11T00:00:00Z</updated>
  {{- end}}
  <id>https://tjp.lol/</id>
  <author>
    <name>tjp</name>
    <email>t@tjp.lol</email>
  </author>
  {{range $posts -}}
  {{$post_date := or (index .Meta "post_date") .ModTime -}}
  <entry>
    <title>{{.Title}}</title>
    <link href="{{.CanonicalURL}}"/>
    <id>{{.CanonicalURL}}</id>
    <published>{{rfc3339 $post_date}}</published>
    <updated>
      {{- if index .Meta "updated" -}}
        {{rfc3339 (index .Meta "updated")}}
      {{- else -}}
        {{rfc3339 $post_date}}
      {{- end -}}
    </updated>
    <content type="html">
      {{- $sawH1 := false}}
      {{- $lede := true}}
      {{- range .Sections}}
        {{- if and $sawH1 $lede}}
          {{- xml .}}
          {{- $lede = false}}
        {{- else if eq (printf "%.3s" .) "<h1"}}
          {{- $sawH1 = true}}
        {{- end}}
      {{- end -}}
    </content>
  </entry>
  {{- end}}
</feed>