added likes

This commit is contained in:
Nuno Coração
2022-09-28 23:43:50 +01:00
parent 0ee898836d
commit cc13795b9e
11 changed files with 130 additions and 6 deletions

View File

@@ -28,10 +28,18 @@
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
{{ end }}
{{ if (.Params.showViews | default (.Site.Params.article.showViews | default true)) }}
{{ if (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
{{ end }}

View File

@@ -0,0 +1,4 @@
<span>
<span id="likes_{{ .Path }}" title="likes">{{- i18n "article.likes" 0 | markdownify | emojify -}}</span>
</span>
{{- /* Trim EOF */ -}}

View File

@@ -0,0 +1,6 @@
<span>
<button id="likes_button" class="border rounded px-3" onclick="process_article()">
Like
</button>
</span>
{{- /* Trim EOF */ -}}