Sha256: fdd989501b94e6670450cd06a64b509a454a7559d720edb814ab85f59534cb2a

Contents?: true

Size: 577 Bytes

Versions: 2

Compression:

Stored size: 577 Bytes

Contents

<!-- Display GoatCounter pageviews -->
<script>
  let pv = document.getElementById('pageviews');

  if (pv !== null) {
    const uri = location.pathname.replace(/\/$/, '');
    const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        const count = data.count.replace(/\s/g, '');
        pv.innerText = new Intl.NumberFormat().format(count);
      })
      .catch((error) => {
        pv.innerText = '1';
      });
  }
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-theme-chirpy-7.1.1 _includes/pageviews/goatcounter.html
jekyll-theme-chirpy-7.1.0 _includes/pageviews/goatcounter.html