Published 2020-10-03.
Last modified 2023-05-18.
Time to read: 1 minutes.
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:
- Absolute filenames (start with
/
). - Filenames relative to the top-level directory of the Jekyll web site (Do not preface with
.
or/
). - Filenames relative to the user home directory (preface with
~
). - 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
.
group :jekyll_plugins do gem 'jekyll_archive_create' end
Install the jekyll_archive_create
gem in the usual manner:
$ 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.
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' ]