This is a Jekyll plugin that makes tar or zip files based on _config.yml
entries.
In production mode, the archives are built each time Jekyll generates the website.
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
.
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.
This plugin supports 4 types of file specifications:
- Absolute filenames (start with
/
). - Filenames relative to the top-level directory of the Jekyll website
(do not preface with
.
or/
). - Filenames relative to the user home directory (preface with
~
). - Executable filenames on the PATH (preface with
!
).
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, '!date' ]
-
archive_name: cloud9.tar
delete: false # Do not overwrite the archive if it already exists
files: [ index.html, 404.html, ~/.ssh/config, /etc/passwd, '!date' ]
The file called date
contains the executable program or script of that name.
More information is available on my website about my Jekyll plugins.
Add this line to your Jekyll project's Gemfile, within the jekyll_plugins
group:
group :jekyll_plugins do
gem 'jekyll_archive_create'
end
And then install dependent gems as usual:
$ bundle
A test/demo website is provided in the demo
directory.
You can run it under a debugger, or let it run free.
The demo/_bin/debug
script can set various parameters for the demo.
View the help information with the -h
option:
$ demo/_bin/debug -h
debug - Run the demo Jekyll website.
By default the demo Jekyll website runs without restriction under ruby-debug-ide and debase.
View it at http://localhost:4444
Options:
-h Show this error message
-r Run freely, without a debugger
To run under a debugger, for example Visual Studio Code:
-
Set breakpoints.
-
Initiate a debug session from the command line:
$ demo/bin/debug
-
Once the
Fast Debugger
signon appears, launch the Visual Studio Code launch configuration calledAttach rdebug-ide
. -
View the generated website at
http://localhost:4444
.
After checking out the repo, run bin/setup
to install dependencies.
You can also run bin/console
for an interactive prompt that will allow you to experiment.
To build and install this gem onto your local machine, run:
$ bundle exec rake install
Examine the newly built gem:
$ gem info jekyll_archive_create
*** LOCAL GEMS ***
jekyll_archive_create (1.0.0)
Author: Mike Slinn
Homepage:
https://github.com/mslinn/jekyll_archive_create
License: MIT
Installed at: /home/mslinn/.gems
Generates Jekyll logger with colored output.
To release a new version,
-
Update the version number in
version.rb
. -
Commit all changes to git; if you don't the next step might fail with an unexplainable error message.
-
Run the following:
$ bundle exec rake release
The above creates a git tag for the version, commits the created tag, and pushes the new
.gem
file to RubyGems.org.
- Fork the project
- Create a descriptively named feature branch
- Add your feature
- Submit a pull request
The gem is available as open source under the terms of the MIT License.