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

23 lines
719 B
HTML
Raw Normal View History

{{ $name := urlize .Title }}
{{ with .Slug }}
2023-04-13 17:19:53 -04:00
{{ $name = . }}
{{ end }}
2023-03-28 17:39:17 -04:00
{{ if hugo.IsProduction }}
2023-09-04 07:59:34 -04:00
<div class="voting-container">
<button class="voting-button" id="num-votes" onClick="addVote({{ $name }})">❤️</button>
</div>
2023-04-13 18:39:55 -04:00
{{ $site := resources.Get "js/voting.js" | minify | fingerprint | resources.PostProcess }}
2023-04-13 17:19:53 -04:00
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
2023-03-28 12:53:02 -04:00
2023-04-17 15:20:26 -04:00
<script>
2023-04-13 17:19:53 -04:00
refresh({{ $name }})
</script>
{{ else }}
2023-09-04 07:59:34 -04:00
<div class="voting-container">
<button disabled class="voting-button" onClick="addVote({{ $name }})">❤️ ?</button>
</div>
{{ end }}