Display Display number of visitors via HITS

2024-09-16 hit count image

Let's see how to display visitors count in the static web site by HITS.

Outline

I use Jekyll and GitHub to write this blog post. I was looking for a way to display the number of visitors on the static site like this, and I found HITS project.

What is HITS

HITS is originally the project to show visitors count for GitHub project.

How to show number of visitors via HITS - HITS for github

To use HITS, visit the site below,

You can see the screen like below.

How to show number of visitors via HITS - HITS service

On above screen, when you insert the URL of the site,

How to show number of visitors via HITS - URL

You can get the URL like below.


[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fdeku.posstree.com%2Fshare%2Fhit-counts%2F&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)

If you insert this link to README on Github, you can display visitors count.

  • Visitors count: Hits

If you refresh, you can see the number is changed dynamically.

Jekyll blog

I use HITS to show the number of visitors on Jekyll blog.

How to show number of visitors via HITS - hits on jekyll

To show visitors count like above, I use the code below on _layouts/post.html.


<img
  style="width: inherit;"
  src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fdev-yakuza.github.io%2F{{ page.url }}&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false"
  alt="hit count image"
/>

Complete

If you use Jekyll, or static site generators for the blog, how about using HITS to show visitors count on the site?

Was my blog helpful? Please leave a comment at the bottom. it will be a great help to me!

App promotion

You can use the applications that are created by this blog writer Deku.
Deku created the applications with Flutter.

If you have interested, please try to download them for free.

Posts