summaryrefslogtreecommitdiff
path: root/layouts/partials/blog/cross-site-post.html
blob: b4384670393012bd0605edc0effaeba8ecf142d0 (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
{{ $section := "some other site" }}

{{ if eq .Section "cool-emacs" }}
  {{ $section = "Cool Emacs" }}
{{ else if eq .Section "brain-rot" }}
  {{ $section = "Brain Rots" }}
{{ else if eq .Section "unix-history" }}
  {{ $section = "Unix History" }}
{{ else if eq .Section "star-trek" }}
  {{ $section = "Star Trek" }}
{{ else if eq .Section "bsd" }}
  {{ $section = "Guide to BSD" }}
{{ end }}

<article class="link">
  {{- $img := resources.Get "blog/assets/arrow.gif" }}
  {{- $img1x := $img.Resize "32x webp" }}
  {{- $img2x := $img.Resize "64x webp" }}
  <div class="img">
  <a href="{{ .Permalink }}"><img
                               alt="Arrow"
                               loading="lazy"
                               src="{{ $img1x.Permalink }}" 
                               srcset="
                                       {{ $img1x.Permalink }} 1x,
                                       {{ $img2x.Permalink }} 2x
                                       "
                               width="{{ $img1x.Width }}" 
                               height="{{ $img1x.Height }}"
                               ></a>
  </div>
  <div class="text">
    <time datetime="{{.PublishDate.Format "2006-01-02" }}">
      {{ .PublishDate.Format "January 2, 2006" }}
    </time><br>
    I published 
    <a href="{{ .Permalink }}">"{{ .Title }}"</a>
    on {{ $section }}
  </div>
</article>