mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-23 14:53:12 +01:00
I've created a simple mechanism to offer me instant feedback that you liked a post. A clap 👏 or a heart ❤️ appear at the bottom of every post, which uses val.town to keep track of current claps. I'm proud that it works well in both Javascript and non-Javascript worlds!
50 lines
1.8 KiB
HTML
50 lines
1.8 KiB
HTML
{{ define "main" }}
|
|
<main class="post poetry">
|
|
|
|
<article class="poem-{{ .Params.align }}">
|
|
<h2 class="post-title"{{ with .Params.emoji }} data-emoji="{{.}}"{{end}}><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></h2>
|
|
|
|
{{ with .Summary }}
|
|
<div class="post-summary p-summary" aria-hidden="true">{{ . }}</div>
|
|
{{ end }}
|
|
|
|
<div class="post-content" data-pagefind-body data-pagefind-filter="type:Poetry">
|
|
{{ if eq .Params.align "monospace" }}
|
|
<pre>{{.RawContent}}</pre>
|
|
{{ else }}
|
|
{{ .Content }}
|
|
{{ end }}
|
|
</div>
|
|
</article>
|
|
|
|
<div class="post-info">
|
|
<p><date datetime="{{ dateFormat .Site.Params.dateformHTML .Date }}" data-pagefind-sort="date">{{ dateFormat .Site.Params.dateform .Date }}</date></p>
|
|
<p><a href="../">back</a></p>
|
|
{{ partial "claps.html" (dict "url" .RelPermalink "style" "heart") }}
|
|
</div>
|
|
|
|
</main>
|
|
{{ if or .Params.prev .Params.next }}
|
|
<div class="pagination">
|
|
<div class="pagination__buttons">
|
|
{{ if .Params.prev }}{{ with .Site.GetPage .Params.prev }}
|
|
<span class="button previous">
|
|
<a href="{{ .RelPermalink }}">
|
|
<span class="button__icon">←</span>
|
|
<span class="button__text">{{ .Title }}</span>
|
|
</a>
|
|
</span>
|
|
{{ end }}{{ end }}
|
|
|
|
{{ if .Params.next }}{{ with .Site.GetPage .Params.next }}
|
|
<span class="button next">
|
|
<a href="{{ .RelPermalink }}">
|
|
<span class="button__text">{{ .Title }}</span>
|
|
<span class="button__icon">→</span>
|
|
</a>
|
|
</span>
|
|
{{ end }}{{ end }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|