22 lines
719 B
HTML
22 lines
719 B
HTML
{{ $name := urlize .Title }}
|
|
|
|
{{ with .Slug }}
|
|
{{ $name = . }}
|
|
{{ end }}
|
|
|
|
{{ if hugo.IsProduction }}
|
|
<div class="voting-container">
|
|
<button class="voting-button" id="num-votes" onClick="addVote({{ $name }})">❤️</button>
|
|
</div>
|
|
|
|
{{ $site := resources.Get "js/voting.js" | minify | fingerprint | resources.PostProcess }}
|
|
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
|
|
|
|
<script>
|
|
refresh({{ $name }})
|
|
</script>
|
|
{{ else }}
|
|
<div class="voting-container">
|
|
<button disabled class="voting-button" onClick="addVote({{ $name }})">❤️ ?</button>
|
|
</div>
|
|
{{ end }}
|