Skip to content

Commit

Permalink
Display number of views per journey entry
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Dec 14, 2024
1 parent 8e7b3b3 commit b12a2a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/handlebars/journey.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ parent: feed
<li><a href="{{link}}">{{name}}</a></li>
{{/each}}
</ul>
{{count views '' '(Eine Ansicht)' '(# Ansichten)'}}
</div>
{{> partials/images in=.}}

Expand Down Expand Up @@ -103,17 +104,17 @@ parent: feed
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
statistics.schedule(entry.target.id);
statistics.schedule('{{journey.slug}}/' + entry.target.id);
} else {
statistics.withdraw(entry.target.id);
statistics.withdraw('{{journey.slug}}/' + entry.target.id);
}
}
},
{ threshold: 0.2 }
);
{{#each itinerary}}
observer.observe(document.querySelector('#{{scroll slug}}'));
statistics.add('{{scroll slug}}', '{{sign slug}}', Math.min({{size images}} * 1500, 5000));
statistics.add('{{slug}}', '{{sign slug}}', Math.min({{size images}} * 1500, 5000));
{{/each}}
</script>
{{/inline}}
Expand Down

0 comments on commit b12a2a2

Please sign in to comment.