<commit_before># metalsmith-gzip [![Build Status](https://travis-ci.org/ludovicofischer/metalsmith-gzip.svg?branch=master)](https://travis-ci.org/ludovicofischer/metalsmith-gzip)

A [Metalsmith](http://metalsmith.io) plugin that lets you create gzipped versions of your build files. This is useful if you are hosting your website on Amazon S3, where it is not possible to set up compression on the server.

## Installation

```
$ npm install metalsmith-gzip
```

## Usage

```javascript
var Metalsmith = require('metalsmith');
var compress = require('metalsmith-gzip');

var metalsmith = new Metalsmith(__dirname)
  .use(compress());

```

metalsmith-gzip will produce a gzipped version of all files in your build whose extension matches the following regular expression

```javascript
/\.[html|css|js|json|xml|svg|txt]/
```

The choice of files to compress is loosely based on the [HTML5 Boilerplate server configuration](https://github.com/h5bp/server-configs-apache).

You will then need to set up a script yourself to upload the gzipped versions of the files to your preferred hosting provider. Take care that the files are served with the correct Content-Encoding.

 At the moment, metalsmith-gzip does not take any configuration options. 

## Acknowledgements

The functionality was inspired by the [Middleman gzip extension](http://middlemanapp.com/advanced/file-size-optimization/). 
<commit_msg>Improve wording. [ci skip]<commit_after># metalsmith-gzip [![Build Status](https://travis-ci.org/ludovicofischer/metalsmith-gzip.svg?branch=master)](https://travis-ci.org/ludovicofischer/metalsmith-gzip)

A [Metalsmith](http://metalsmith.io) plugin that creates gzipped copies of your site's content. This is useful if you are hosting your website on Amazon S3, where it is not possible to set up compression on the server.

## Installation

```
$ npm install metalsmith-gzip
```

## Usage

```javascript
var Metalsmith = require('metalsmith');
var compress = require('metalsmith-gzip');

var metalsmith = new Metalsmith(__dirname)
  .use(compress());

```

metalsmith-gzip will gzip a file if the extension matches this regular expression:

```javascript
/\.[html|css|js|json|xml|svg|txt]/
```

The choice of files to compress is loosely based on the [HTML5 Boilerplate server configuration](https://github.com/h5bp/server-configs-apache).

You will then need to set up a script yourself to upload the gzipped versions of the files to your preferred hosting provider. Take care that the files are served with the correct Content-Encoding.

## Acknowledgements

This plugin was inspired by the [Middleman gzip extension](http://middlemanapp.com/advanced/file-size-optimization/). 

{'fraction_non_alphanumeric': 0.10353817504655494, 'fraction_numerical': 0.0022346368715083797, 'mean_word_length': 5.118451025056948, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3645559', 'n_tokens_mistral': 837, 'n_tokens_neox': 766, 'n_words': 280}