mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
added likes
This commit is contained in:
@@ -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 }}
|
||||
|
||||
4
layouts/partials/meta/likes.html
Normal file
4
layouts/partials/meta/likes.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<span>
|
||||
<span id="likes_{{ .Path }}" title="likes">{{- i18n "article.likes" 0 | markdownify | emojify -}}</span>
|
||||
</span>
|
||||
{{- /* Trim EOF */ -}}
|
||||
6
layouts/partials/meta/likes_button.html
Normal file
6
layouts/partials/meta/likes_button.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<span>
|
||||
<button id="likes_button" class="border rounded px-3" onclick="process_article()">
|
||||
Like
|
||||
</button>
|
||||
</span>
|
||||
{{- /* Trim EOF */ -}}
|
||||
Reference in New Issue
Block a user