Display Display number of visitors via HITS

2025-05-06 hit count image

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

Deprecated

The HITS service introduced in this blog post is no longer available. If you want to use a service similar to HITS, please try the following service.

You can use the following code to display the visitor count in the Markdown document.


[![hits](https://myhits.vercel.app/api/hit/https%3A%2F%2Fdeku.posstree.com?color=blue&label=hits&size=small)](https://myhits.vercel.app)

You can also use the following code in HTML format.


<img src="https://myhits.vercel.app/api/hit/https%3A%2F%2Fdeku.posstree.com?color=blue&label=hits&size=small" alt="hits" />

If you are using Jekyll like me, you can modify the page.url as follows.


<img style="width: inherit;" src="https://myhits.vercel.app/api/hit/https%3A%2F%2Fdeku.posstree.com{{ page.url | replace:'/', '%2F' }}?color=red&label=hits&size=medium" alt="hit count image"/>

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