Update .Path to .File.Path to fix deprecation warnings.

This commit is contained in:
miodzie 2022-09-30 18:10:49 -04:00
parent 172f90ac75
commit 927c76ce18
2 changed files with 5 additions and 5 deletions

View file

@ -27,7 +27,7 @@
var liked_article = false
if (typeof auth !== 'undefined') {
var oid = "views_{{ .Path }}"
var oid = "views_{{ .File.Path }}"
var id = oid ? oid.replaceAll("/", "-") : oid
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 liked = localStorage.getItem(id_likes);
@ -123,7 +123,7 @@
}
function process_article() {
var oid_likes = "likes_{{ .Path }}"
var oid_likes = "likes_{{ .File.Path }}"
var id_likes = oid_likes ? oid_likes.replaceAll("/", "-") : oid_likes
if (!liked_article) {
like_article(id_likes)
@ -151,4 +151,4 @@
{{ end }}
</footer>
</article>
{{ end }}
{{ end }}

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 -}}
</span>
{{- /* Trim EOF */ -}}