Files
personal-website/layouts/partials/card.html
T
2024-05-05 16:14:33 +01:00

28 lines
1018 B
HTML

<article class="card">
<div>
<h3>{{ .Title }}</h3>
{{ if .InSection ($.Site.GetPage "blog") }}
<b>{{ .Date.Format .Site.Params.dateFormat }}</b>
{{ end }}
<p>{{ .Params.description }}</p>
<div id="links">
<a
class="read-more"
href="{{ if (.InSection ($.Site.GetPage "projects")) }} {{ .Params.source }} {{ else }} {{ .Permalink }} {{ end }}"
target="{{ if (.InSection ($.Site.GetPage "projects")) }} _blank {{ else }} _self {{ end }}"
>
{{ if (.InSection ($.Site.GetPage "projects")) }}
Source code {{ readFile "assets/icons/arrow.svg" | safeHTML }}
{{ else }}
Read this blog post {{ readFile "assets/icons/arrow.svg" | safeHTML }}
{{ end }}
</a>
{{ with (and (.InSection ($.Site.GetPage "projects")) .Params.demo) }}
<a class="demo" href="{{ . }}" target="_blank">
Demo {{ readFile "assets/icons/eye.svg" | safeHTML }}
</a>
{{ end }}
</div>
</div>
</article>