Merge pull request #49 from miodzie/main

Update .Path to .File.Path to fix deprecation warnings.
This commit is contained in:
Nuno Coração 2022-09-30 23:41:34 +01:00 committed by GitHub
commit d2433b5072
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -27,7 +27,7 @@
var liked_article = false var liked_article = false
if (typeof auth !== 'undefined') { if (typeof auth !== 'undefined') {
var oid = "views_{{ .Path }}" var oid = "views_{{ .File.Path }}"
var id = oid ? oid.replaceAll("/", "-") : oid var id = oid ? oid.replaceAll("/", "-") : oid
var viewed = localStorage.getItem(id); var viewed = localStorage.getItem(id);
@ -56,7 +56,7 @@
}); });
} }
var oid_likes = "likes_{{ .Path }}" var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
var liked = localStorage.getItem(id_likes); var liked = localStorage.getItem(id_likes);
@ -123,7 +123,7 @@
} }
function process_article() { function process_article() {
var oid_likes = "likes_{{ .Path }}" var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
if (!liked_article) { if (!liked_article) {
like_article(id_likes) like_article(id_likes)

View file

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