jekyll-site-size

a jekyll generator plugin that calculates total file size of your website and makes it available as a variable in multiple formats (bytes, kb, mb).

installation

add to your Gemfile:

gem 'jekyll-site-size'

then run bundle install.

or for local use, copy site_size.rb into your site's _plugins/ directory.

usage

after installation, the following variables are available in any page:

{{ site.site_size_human }}   <!-- e.g. "342.1 KB" -->
{{ site.site_size_kb }}      <!-- e.g. 342.1 -->
{{ site.site_size_mb }}      <!-- e.g. 0.33 -->
{{ site.site_size_bytes }}   <!-- e.g. 350310 -->

example

<p>Total site size: {{ site.site_size_human }}</p>

note: the plugin measures the _site directory at the start of each build, so it reports the size of the previous build's output. on a first build (when _site doesn't exist yet), no variables are set.

background

inspired by low-tech websites, permacomputing and associated tendencies. calculating website size in the spirit of affirming small file media, media minimisation, ditherpunk, etc.