Mike Slinn

jekyll_archive_create

Published 2020-10-03. Last modified 2023-05-18.
Time to read: 1 minutes.

This page is part of the jekyll_plugins collection.

Originally called make_archive, this Jekyll generator plugin creates tar and zip archives according to the make_archive entry in _config.yml. Archives are placed in the top-level of the Jekyll project, and are copied to _site by Jekyll’s normal build process. Entries are created in .gitignore for each of the generated archives.

In production mode, the archives are built each time Jekyll generates the web site.

In development mode, the archives are only built if they do not already exist, or if delete: true is set for that archive in _config.yml.

File Specifications

This plugin supports 4 types of file specifications:

  1. Absolute filenames (start with /).
  2. Filenames relative to the top-level directory of the Jekyll web site (Do not preface with . or /).
  3. Filenames relative to the user home directory (preface with ~).
  4. Executable programs on the PATH (preface with !).

Installation

Jekyll_archive_create is packaged as a Ruby gem. add the following line to your Jekyll project’s Gemfile.

Gemfile
group :jekyll_plugins do 
  gem 'jekyll_archive_create'
end 

Install the jekyll_archive_create gem in the usual manner:

Shell
$ bundle

_config.yml Syntax

Any number of archives can be specified. Each archive has 3 properties: archive_name, delete (defaults to true) and files. Take care that the dashes have exactly 2 spaces before them, and that the 2 lines following each dash have exactly 4 spaces in front.

_config.yml fragment
make_archive:
  -
    archive_name: cloud9.zip
    delete: true  # This is the default, and need not be specified.
    files: [ index.html, 404.html, ~/.ssh/config, /etc/passwd, '!update' ]
  -
    archive_name: cloud9.tar
    delete: false  # Do not overwrite the archive if it already exists
    files: [ index.html, 404.html, ~/.ssh/config, /etc/passwd, '!update' ]
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.