redstrate.com/themes/red/layouts/partials/voting.html

27 lines
760 B
HTML
Raw Normal View History

{{ $name := urlize .Title }}
{{ with .Slug }}
{{ $name = . }}
{{ end }}
2023-03-28 12:53:02 -04:00
<div style="width: 100px; margin-top: 20px; margin-bottom: 20px; margin-left: auto; margin-right: auto">
<button style="display: block; margin-left: auto; margin-right: auto" onClick="addVote({{ $name }})">Cool!</button>
2023-03-28 12:53:02 -04:00
<p style="text-align: center" id="num-votes">...</p>
</div>
2023-03-28 17:39:17 -04:00
{{ if hugo.IsProduction }}
2023-03-28 12:53:02 -04:00
{{ $site := resources.Get "js/voting.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
<script type="text/javascript">
refresh({{ $name }})
2023-03-28 12:53:02 -04:00
</script>
{{ else }}
<p>debug: {{ $name }}</p>
{{ end }}