Display Display number of visitors via HITS

2024-03-26 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 username and repo/project of GitHub,

How to show number of visitors via HITS - username, repo/project

You can get the URL like below.


![HitCount](http://hits.dwyl.com/dev-yakuza/react-native-image-modal.svg)

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

  • Visitors count: HitCount

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="http://hits.dwyl.com/dev-yakuza.github.io{{ page.url }}.svg"
  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